Blender V5.3
node_tree_evaluator.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#include <limits>
6
8#include "BLI_set.hh"
9#include "BLI_string_ref.hh"
10#include "BLI_vector.hh"
11#include "BLI_vector_set.hh"
12
13#include "DNA_node_types.h"
14
15#include "BKE_node.hh"
16#include "BKE_node_runtime.hh"
18
20#include "COM_context.hh"
21#include "COM_domain.hh"
26#include "COM_node_operation.hh"
32#include "COM_result.hh"
33#include "COM_scheduler.hh"
37#include "COM_utilities.hh"
39
40namespace blender::compositor {
41
43 const Schedule &schedule,
44 Operation &operation,
45 const ComputeContext &compute_context)
46 : context_(context),
47 schedule_(schedule),
48 operation_(operation),
49 compute_context_(compute_context)
50{
51}
52
54{
55 this->compute_zone_external_input_reference_counts();
56
57 for (const bNode *node : this->schedule().nodes) {
58 if (this->context().is_canceled()) {
59 this->cancel_evaluation();
60 break;
61 }
62
63 if (this->should_compile_pixel_compile_unit(*node)) {
64 this->evaluate_pixel_compile_unit();
65 }
66
67 if (is_pixel_node(*node)) {
68 this->add_node_to_pixel_compile_unit(*node);
69 continue;
70 }
71
72 const bke::bNodeTreeZones &zones = *node->owner_tree().zones();
73 const bke::bNodeTreeZone *node_zone = zones.get_zone_by_node(node->identifier);
74 if (node_zone && node_zone != this->schedule().zone) {
75 BLI_assert(node == node_zone->output_node());
76 this->evaluate_zone(*node_zone);
77 continue;
78 }
79
80 this->evaluate_node(*node);
81 }
82}
83
85{
86 const bNode &node = output.owner_node();
87 /* The output belongs to a node that was compiled into a standard node operation. */
88 NodeOperation *node_operation = node_operations_.lookup_default(&node, nullptr);
89 if (node_operation) {
90 return node_operation->get_result(output.identifier);
91 }
92
93 /* The output belongs to a node that was compiled into a pixel operation. */
94 PixelOperation *pixel_operation = pixel_operations_.lookup_default(&node, nullptr);
95 if (pixel_operation) {
96 const StringRef identifier = pixel_operation->get_output_identifier_from_output_socket(output);
97 return pixel_operation->get_result(identifier);
98 }
99
100 /* The output belongs to a zone output node that was compiled into a zone operation. */
101 ZoneOperation *zone_operation = zone_operations_.lookup_default(&node, nullptr);
102 if (zone_operation) {
103 return zone_operation->get_result(output.identifier);
104 }
105
106 /* If the output is in a different zone, then we retrieve the result from the ZoneTreeOperation
107 * operation using its special identifier. */
108 const bke::bNodeTreeZones &zones = *output.owner_tree().zones();
109 const bke::bNodeTreeZone *node_zone = zones.get_zone_by_node(node.identifier);
110 if (node_zone != this->schedule().zone) {
111 return this->operation().get_input(ZoneTreeOperation::get_external_input_identifier(output));
112 }
113
115 return node_operation->get_result(output.identifier);
116}
117
119{
120 return pixel_compile_unit_;
121}
122
124{
125 return schedule_;
126}
127
128void NodeTreeEvaluator::compute_zone_external_input_reference_counts()
129{
130 /* Not evaluating a zone, nothing to do. */
131 if (!this->schedule().zone) {
132 return;
133 }
134
135 Set<const bNodeSocket *> outputs_already_considered;
136 for (const bNodeLink *link : this->schedule().zone->border_links) {
137 const bNodeSocket *output = get_output_linked_to_input(*link->tosock);
138 if (!output) {
139 continue;
140 }
141
142 if (outputs_already_considered.contains(output)) {
143 continue;
144 }
145 outputs_already_considered.add_new(output);
146
147 const int reference_count = compute_output_reference_count(*output, this->schedule());
149 result.set_reference_count(result.reference_count() + reference_count);
150 }
151}
152
153/* Identifies if the given node is a node tree input, this includes the Group Input and Zone Input
154 * nodes. Those nodes are a special case, while they are compiled as node operation, their outputs
155 * are retrieved from the operation using the evaluator, while their inputs are ignored from the
156 * perspective of the node operation. */
158{
159 return node.is_group_input() || bke::all_zone_input_node_types().contains(node.type_legacy);
160}
161
162NodeOperation *NodeTreeEvaluator::create_node_operation(const bNode &node)
163{
164 const char *disabled_hint = nullptr;
165 if (!node.typeinfo->poll(node.typeinfo, &node.owner_tree(), &disabled_hint)) {
166 return get_undefined_node_operation(this->context(), node);
167 }
168
169 if (node.is_group()) {
170 return get_group_node_operation(this->context(), node);
171 }
172
173 if (node.is_group_output() || bke::all_zone_output_node_types().contains(node.type_legacy)) {
174 return get_node_tree_output_node_operation(this->context(), node, this->operation());
175 }
176
178 return get_node_tree_input_node_operation(this->context(), node, this->operation());
179 }
180
181 return node.typeinfo->get_compositor_operation(this->context(), node);
182}
183
184void NodeTreeEvaluator::evaluate_node(const bNode &node)
185{
186 NodeOperation *operation = this->create_node_operation(node);
187 operation->set_compute_context(compute_context_);
188
189 node_operations_.add_new(&node, operation);
190
191 this->map_node_operation_inputs_to_their_results(node, operation);
192
193 operations_stream_.append(std::unique_ptr<Operation>(operation));
194
195 operation->compute_results_reference_counts(this->schedule());
196
197 operation->evaluate();
198}
199
200void NodeTreeEvaluator::map_unlinked_input(const bNodeSocket &input, Operation *operation)
201{
202 const InputDescriptor input_descriptor = input_descriptor_from_input_socket(&input);
203 if (!input_descriptor.implicit_input.has_value()) {
204 SingleValueNodeInputOperation *input_operation = new SingleValueNodeInputOperation(
205 this->context(), input);
206 operations_stream_.append(std::unique_ptr<SingleValueNodeInputOperation>(input_operation));
207 input_operation->evaluate();
208 operation->map_input_to_result(input.identifier, &input_operation->get_result());
209 return;
210 }
211
212 ImplicitInputOperation *input_operation = new ImplicitInputOperation(
213 this->context(), input_descriptor.implicit_input.value());
214 operations_stream_.append(std::unique_ptr<ImplicitInputOperation>(input_operation));
215 input_operation->evaluate();
216 operation->map_input_to_result(input.identifier, &input_operation->get_result());
217}
218
219void NodeTreeEvaluator::map_node_operation_inputs_to_their_results(const bNode &node,
220 NodeOperation *operation)
221{
222 for (const bNodeSocket *input : node.input_sockets()) {
223 if (!is_socket_available(input)) {
224 continue;
225 }
226
227 const bNodeSocket *output = get_output_linked_to_input(*input);
228 if (!output || this->schedule().unneeded_inputs.contains(input) ||
230 {
231 this->map_unlinked_input(*input, operation);
232 continue;
233 }
234
236 operation->map_input_to_result(input->identifier, &result);
237 }
238}
239
240PixelOperation *NodeTreeEvaluator::create_pixel_operation()
241{
242 /* Use multi-function procedure to execute the pixel compile unit for CPU contexts or if the
243 * compile unit is single value and would thus be more efficient to execute on the CPU. */
244 const bool is_single_value = this->is_pixel_compile_unit_single_value();
245 if (!this->context().use_gpu() || is_single_value) {
247 this->context(), *this, is_single_value, compute_context_);
248 }
249
250 return new ShaderOperation(this->context(), *this, compute_context_);
251}
252
253void NodeTreeEvaluator::evaluate_pixel_compile_unit()
254{
255 PixelCompileUnit &compile_unit = this->pixel_compile_unit();
256
257 /* Only compute previews if they are needed and the node group is currently active. */
258 const bool needs_node_previews = flag_is_set(this->context().needed_side_effect_output_types(),
260
261 /* Pixel operations might have limitations on the number of outputs or inputs they can have, so
262 * we might have to split the compile unit into smaller units to workaround this limitation. In
263 * practice, splitting will almost always never happen due to the scheduling strategy we use, so
264 * the base case remains fast. */
265 if (compile_unit.size() > 1 &&
266 (this->pixel_compile_unit_has_too_many_outputs(needs_node_previews) ||
267 this->pixel_compile_unit_has_too_many_inputs()))
268 {
269 const int split_index = compile_unit.size() / 2;
270 const PixelCompileUnit start_compile_unit(compile_unit.as_span().take_front(split_index));
271 const PixelCompileUnit end_compile_unit(compile_unit.as_span().drop_front(split_index));
272
273 this->pixel_compile_unit() = start_compile_unit;
274 this->evaluate_pixel_compile_unit();
275
276 this->pixel_compile_unit() = end_compile_unit;
277 this->evaluate_pixel_compile_unit();
278
279 /* No need to continue, the above recursive calls will eventually exist the loop and do the
280 * actual compilation. */
281 return;
282 }
283
284 PixelOperation *operation = this->create_pixel_operation();
285
286 for (const bNode *node : compile_unit) {
287 pixel_operations_.add_new(node, operation);
288 }
289
290 map_pixel_operation_inputs_to_their_results(operation);
291
292 operations_stream_.append(std::unique_ptr<Operation>(operation));
293
294 operation->compute_results_reference_counts(this->schedule());
295
296 operation->evaluate();
297
298 this->reset_pixel_compile_unit();
299}
300
301void NodeTreeEvaluator::map_pixel_operation_inputs_to_their_results(PixelOperation *operation)
302{
303 for (const auto item : operation->get_inputs_to_linked_outputs_map().items()) {
304 const bNodeSocket &output = *item.value;
305 const StringRef input_identifier = item.key;
306
307 Result *input_result = &this->get_result_from_output_socket(output);
308 operation->map_input_to_result(input_identifier, input_result);
309
310 /* Correct the reference count of the result in case multiple of the result's outgoing links
311 * corresponds to a single input in the pixel operation. See the description of the member
312 * inputs_to_reference_counts_map_ variable for more information. */
313 const int internal_reference_count = operation->get_internal_input_reference_count(
314 input_identifier);
315 input_result->decrement_reference_count(internal_reference_count - 1);
316 }
317
318 for (const auto item : operation->get_implicit_inputs_to_input_identifiers_map().items()) {
319 ImplicitInputOperation *input_operation = new ImplicitInputOperation(this->context(),
320 item.key);
321 operation->map_input_to_result(item.value, &input_operation->get_result());
322
323 operations_stream_.append(std::unique_ptr<ImplicitInputOperation>(input_operation));
324
325 input_operation->evaluate();
326 }
327}
328
329ZoneOperation *NodeTreeEvaluator::create_zone_operation(const bke::bNodeTreeZone &zone)
330{
331 if (zone.output_node()->is_type("GeometryNodeRepeatOutput"_ustr)) {
332 return new RepeatZoneOperation(this->context(), zone, compute_context_);
333 }
334 if (zone.output_node()->is_type("NodeClosureOutput"_ustr)) {
335 return new ClosureZoneOperation(this->context(), zone, compute_context_);
336 }
337
339 return nullptr;
340}
341
342void NodeTreeEvaluator::evaluate_zone(const bke::bNodeTreeZone &zone)
343{
344 ZoneOperation *operation = this->create_zone_operation(zone);
345
346 zone_operations_.add_new(zone.output_node(), operation);
347
348 this->map_zone_operation_inputs_to_their_results(operation);
349
350 operations_stream_.append(std::unique_ptr<Operation>(operation));
351
352 operation->compute_results_reference_counts(this->schedule());
353
354 operation->evaluate();
355}
356
357void NodeTreeEvaluator::map_zone_operation_inputs_to_their_results(ZoneOperation *operation)
358{
359 for (const bNodeSocket *input : operation->zone().input_node()->input_sockets()) {
360 if (!is_socket_available(input)) {
361 continue;
362 }
363
364 const bNodeSocket *output = get_output_linked_to_input(*input);
365 if (!output || this->schedule().unneeded_inputs.contains(input)) {
366 this->map_unlinked_input(*input, operation);
367 continue;
368 }
369
370 Result &input_result = this->get_result_from_output_socket(*output);
371 operation->map_input_to_result(input->identifier, &input_result);
372 }
373
374 Set<const bNodeSocket *> outputs_already_considered;
375 for (const bNodeLink *link : operation->zone().border_links) {
376 const bNodeSocket *output = get_output_linked_to_input(*link->tosock);
377 if (!output) {
378 continue;
379 }
380
381 if (outputs_already_considered.contains(output)) {
382 continue;
383 }
384 outputs_already_considered.add_new(output);
385
386 std::string input_identifier = ZoneTreeOperation::get_external_input_identifier(*output);
387 Result *input_result = &this->get_result_from_output_socket(*output);
388 operation->map_input_to_result(input_identifier, input_result);
389 }
390}
391
392void NodeTreeEvaluator::add_node_to_pixel_compile_unit(const bNode &node)
393{
394 pixel_compile_unit_.add_new(&node);
395
396 /* If this is the first node in the compile unit, then we should initialize the single value
397 * type, as well as the domain in case the node was not single value. */
398 const bool is_first_node_in_operation = pixel_compile_unit_.size() == 1;
399 if (is_first_node_in_operation) {
400 is_pixel_compile_unit_single_value_ = this->is_pixel_node_single_value(node);
401
402 /* If the node was not a single value, compute and initialize the domain. */
403 if (!is_pixel_compile_unit_single_value_) {
404 pixel_compile_unit_domain_ = this->compute_pixel_node_domain(node);
405 }
406 }
407}
408
409bool NodeTreeEvaluator::is_pixel_compile_unit_single_value()
410{
411 return is_pixel_compile_unit_single_value_;
412}
413
414void NodeTreeEvaluator::reset_pixel_compile_unit()
415{
416 pixel_compile_unit_.clear();
417 pixel_compile_unit_domain_.reset();
418}
419
420bool NodeTreeEvaluator::should_compile_pixel_compile_unit(const bNode &node)
421{
422 /* If the pixel compile unit is empty, then it can't be compiled yet. */
423 if (pixel_compile_unit_.is_empty()) {
424 return false;
425 }
426
427 /* If the node is not a pixel node, then it can't be added to the pixel compile unit and the
428 * pixel compile unit is considered complete and should be compiled. */
429 if (!is_pixel_node(node)) {
430 return true;
431 }
432
433 /* If the compile unit is single value and the given node is not or vice versa, then it can't be
434 * added to the pixel compile unit and the pixel compile unit is considered complete and should
435 * be compiled. */
436 if (is_pixel_compile_unit_single_value_ != this->is_pixel_node_single_value(node)) {
437 return true;
438 }
439
440 /* For non single value compile units, if the computed domain of the node doesn't matches the
441 * domain of the pixel compile unit, then it can't be added to the pixel compile unit and the
442 * pixel compile unit is considered complete and should be compiled. */
443 if (!is_pixel_compile_unit_single_value_) {
444 if (pixel_compile_unit_domain_.value() != this->compute_pixel_node_domain(node)) {
445 return true;
446 }
447 }
448
449 /* Otherwise, the node is compatible and can be added to the compile unit and it shouldn't be
450 * compiled just yet. */
451 return false;
452}
453
454bool NodeTreeEvaluator::is_pixel_node_single_value(const bNode &node)
455{
456 /* If any of the outputs are single-only outputs, then the node is operating on single values. */
457 for (const bNodeSocket *output : node.output_sockets()) {
459 continue;
460 }
461
463 return true;
464 }
465 }
466
467 /* If any of the inputs are single-only outputs, then the node is operating on single values. */
468 for (const bNodeSocket *input : node.input_sockets()) {
469 if (!is_socket_available(input)) {
470 continue;
471 }
472
474 return true;
475 }
476 }
477
478 /* The pixel node is single value when all of its inputs are single values. */
479 for (const bNodeSocket *input : node.input_sockets()) {
480 if (!is_socket_available(input)) {
481 continue;
482 }
483
484 const bNodeSocket *output = get_output_linked_to_input(*input);
485 if (!output) {
486 /* The input does not have an implicit input, so it is a single value. */
487 const InputDescriptor input_descriptor = input_descriptor_from_input_socket(input);
488 if (!input_descriptor.implicit_input.has_value()) {
489 continue;
490 }
491
492 const std::optional<Domain> domain = ImplicitInputOperation::get_domain(
493 context_, input_descriptor.implicit_input.value());
494 if (!domain.has_value()) {
495 /* The input has an implicit input, but it is a single value. */
496 continue;
497 }
498
499 /* Otherwise, it has an non-single-value implicit input. */
500 return false;
501 }
502
503 /* If the output belongs to a node that is part of the pixel compile unit and that compile unit
504 * is not single value, then the node is not single value. */
505 if (pixel_compile_unit_.contains(&output->owner_node())) {
506 if (is_pixel_compile_unit_single_value_) {
507 continue;
508 }
509 return false;
510 }
511
513 if (!result.is_single_value()) {
514 return false;
515 }
516 }
517
518 return true;
519}
520
521Domain NodeTreeEvaluator::compute_pixel_node_domain(const bNode &node)
522{
523 /* Default to an identity domain in case no domain input was found, most likely because all
524 * inputs are single values. */
525 Domain node_domain = Domain::identity();
526 int current_domain_priority = std::numeric_limits<int>::max();
527
528 /* Go over the inputs and find the domain of the non single value input with the highest domain
529 * priority. */
530 for (const bNodeSocket *input : node.input_sockets()) {
531 if (!is_socket_available(input)) {
532 continue;
533 }
534
535 const InputDescriptor input_descriptor = input_descriptor_from_input_socket(input);
536
537 const bNodeSocket *output = get_output_linked_to_input(*input);
538 if (!output) {
539 /* The input does not have an implicit input, so it is a single that can't be a domain input
540 * and we skip it. */
541 if (!input_descriptor.implicit_input.has_value()) {
542 continue;
543 }
544
545 const std::optional<Domain> domain = ImplicitInputOperation::get_domain(
546 context_, input_descriptor.implicit_input.value());
547 if (!domain.has_value()) {
548 /* The input has an implicit input, but it is a single value that can't be a domain input
549 * and we skip it. */
550 continue;
551 }
552
553 /* Otherwise, the input has the domain of the implicit input, which is the domain of the
554 * compositing region. Notice that the lower the domain priority value is, the higher the
555 * priority is, hence the less than comparison. */
556 if (input_descriptor.domain_priority < current_domain_priority) {
557 node_domain = domain.value();
558 current_domain_priority = input_descriptor.domain_priority;
559 }
560 continue;
561 }
562
563 /* If the output belongs to a node that is part of the pixel compile unit, then the domain of
564 * the input is the domain of the compile unit itself. */
565 if (pixel_compile_unit_.contains(&output->owner_node())) {
566 /* Notice that the lower the domain priority value is, the higher the priority is, hence the
567 * less than comparison. */
568 if (input_descriptor.domain_priority < current_domain_priority) {
569 node_domain = pixel_compile_unit_domain_.value();
570 current_domain_priority = input_descriptor.domain_priority;
571 }
572 continue;
573 }
574
576
577 /* A single value input can't be a domain input. */
578 if (result.is_single_value() || input_descriptor.expects_single_value) {
579 continue;
580 }
581
582 /* An input that skips operation domain realization can't be a domain input. */
583 if (input_descriptor.realization_mode != InputRealizationMode::OperationDomain) {
584 continue;
585 }
586
587 /* Notice that the lower the domain priority value is, the higher the priority is, hence the
588 * less than comparison. */
589 if (input_descriptor.domain_priority < current_domain_priority) {
590 node_domain = result.domain();
591 current_domain_priority = input_descriptor.domain_priority;
592 }
593 }
594
595 return node_domain;
596}
597
598bool NodeTreeEvaluator::pixel_compile_unit_has_too_many_outputs(
599 const bool are_node_previews_needed)
600{
601 /* Only GPU and non-single units have output count limitations. */
602 if (!context_.use_gpu() || is_pixel_compile_unit_single_value_) {
603 return false;
604 }
605
606 int outputs_count = 0;
607 for (const bNode *node : pixel_compile_unit_) {
608 const bNodeSocket *preview_output = are_node_previews_needed ?
610 nullptr;
611
612 for (const bNodeSocket *output : node->output_sockets()) {
614 continue;
615 }
616
617 /* If the output is used as the node preview, then an operation output will exist for it. */
618 const bool is_preview_output = output == preview_output;
619
620 /* If the output is referenced by the schedule outside of the pixel compile unit, then an
621 * output result needs to be populated for it. */
622 const bool is_operation_output = compute_output_reference_count(
623 *output, schedule_, &pixel_compile_unit_) != 0;
624
625 if (is_operation_output || is_preview_output) {
626 outputs_count += 1;
627 }
628
629 if (outputs_count > ShaderOperation::maximum_outputs_count) {
630 return true;
631 }
632 }
633 }
634
635 return false;
636}
637
638bool NodeTreeEvaluator::pixel_compile_unit_has_too_many_inputs()
639{
640 /* Only GPU and non-single units have input count limitations. */
641 if (!context_.use_gpu() || is_pixel_compile_unit_single_value_) {
642 return false;
643 }
644
645 Set<ImplicitInputType> referenced_implicit_inputs;
646 Set<const bNodeSocket *> referenced_output_sockets;
647 int inputs_count = 0;
648 for (const bNode *node : pixel_compile_unit_) {
649 for (const bNodeSocket *input : node->input_sockets()) {
650 if (!is_socket_available(input)) {
651 continue;
652 }
653
654 if (this->schedule().unneeded_inputs.contains(input)) {
655 continue;
656 }
657
658 const bNodeSocket *output = get_output_linked_to_input(*input);
659 if (!output) {
660 const InputDescriptor input_descriptor = input_descriptor_from_input_socket(input);
661 if (!input_descriptor.implicit_input.has_value()) {
662 continue;
663 }
664
665 /* All implicit inputs of the same type share the same input, and this one was counted
666 * before, so no need to count it again. */
667 if (referenced_implicit_inputs.contains(input_descriptor.implicit_input.value())) {
668 continue;
669 }
670
671 inputs_count++;
672 if (inputs_count > ShaderOperation::maximum_inputs_count) {
673 return true;
674 }
675
676 referenced_implicit_inputs.add_new(input_descriptor.implicit_input.value());
677 continue;
678 }
679
680 /* This output is part of the pixel compile unit, so no input is declared for it. */
681 if (pixel_compile_unit_.contains(&output->owner_node())) {
682 continue;
683 }
684
685 /* All inputs linked to the same output share the same input, and this one was counted
686 * before, so no need to count it again. */
687 if (referenced_output_sockets.contains(output)) {
688 continue;
689 }
690
691 /* Single values are folded into the shader so they do not count toward inputs count. */
692 const Result &result = this->get_result_from_output_socket(*output);
693 if (result.is_single_value()) {
694 continue;
695 }
696
697 inputs_count++;
698 if (inputs_count > ShaderOperation::maximum_inputs_count) {
699 return true;
700 }
701
702 referenced_output_sockets.add_new(output);
703 }
704 }
705
706 return false;
707}
708
709void NodeTreeEvaluator::cancel_evaluation()
710{
711 for (const std::unique_ptr<Operation> &operation : operations_stream_) {
712 operation->free_results();
713 }
714}
715
716Context &NodeTreeEvaluator::context()
717{
718 return context_;
719}
720
721Operation &NodeTreeEvaluator::operation()
722{
723 return operation_;
724}
725
726} // namespace blender::compositor
#define BLI_assert_unreachable()
#define output
bool contains(const Key &key) const
Definition BLI_set.hh:310
void add_new(const Key &key)
Definition BLI_set.hh:233
const bNode * output_node() const
const bNodeTreeZone * get_zone_by_node(const int32_t node_id) const
static Domain identity()
Definition domain.cc:47
static std::optional< Domain > get_domain(const Context &context, const ImplicitInputType implicit_input)
ImplicitInputOperation(Context &context, const ImplicitInputType implicit_input)
MultiFunctionProcedureOperation(Context &context, NodeTreeEvaluator &node_tree_evaluator, const bool is_single_value, const ComputeContext &compute_context)
Result & get_result_from_output_socket(const bNodeSocket &output)
NodeTreeEvaluator(Context &context, const Schedule &schedule, Operation &operation, const ComputeContext &compute_context)
Result & get_result(StringRef identifier)
Definition operation.cc:40
StringRef get_output_identifier_from_output_socket(const bNodeSocket &output_socket)
static bool is_single_value_only_type(ResultType type)
Definition result.cc:51
ShaderOperation(Context &context, NodeTreeEvaluator &node_tree_evaluator, const ComputeContext &compute_context)
SingleValueNodeInputOperation(Context &context, const bNodeSocket &input_socket)
static std::string get_external_input_identifier(const bNodeSocket &output)
Span< int > all_zone_output_node_types()
Span< int > all_zone_input_node_types()
int compute_output_reference_count(const bNodeSocket &output, const Schedule &schedule, const VectorSet< const bNode * > *ignored_nodes=nullptr)
Definition scheduler.cc:780
const bNodeSocket * find_preview_output_socket(const bNode &node)
Definition utilities.cc:258
const bNodeSocket * get_output_linked_to_input(const bNodeSocket &input)
Definition utilities.cc:31
NodeOperation * get_node_tree_input_node_operation(Context &context, const bNode &node, Operation &operation)
NodeOperation * get_group_node_operation(Context &context, const bNode &node)
ResultType get_node_socket_result_type(const bNodeSocket *socket)
Definition utilities.cc:103
bool is_pixel_node(const bNode &node)
Definition utilities.cc:154
static bool is_node_tree_input_node(const bNode &node)
VectorSet< const bNode * > PixelCompileUnit
InputDescriptor input_descriptor_from_input_socket(const bNodeSocket *socket)
Definition utilities.cc:195
NodeOperation * get_undefined_node_operation(Context &context, const bNode &node)
bool is_socket_available(const bNodeSocket *socket)
Definition utilities.cc:26
NodeOperation * get_node_tree_output_node_operation(Context &context, const bNode &node, Operation &operation)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)