|
Blender V4.5
|
#include <BKE_compute_context_cache.hh>
When traversing the computation of a node tree (like in socket_usage_inference.cc or partial_eval.cc) one often enters and exists the same compute contexts. The cache implemented here avoids re-creating the same compute contexts over and over again. While requiring less memory and having potentially better performance, it can also be used to ensure that the same compute context will always have the same pointer, even if it's created in two different places.
Constructing compute contexts through this cache can also be a bit more convenient.
Definition at line 25 of file BKE_compute_context_cache.hh.
|
inline |
A fallback that does not use caching and can be used for any compute context. More constructors like the ones above can be added as they become necessary.
Definition at line 85 of file BKE_compute_context_cache.hh.
Referenced by for_evaluate_closure(), for_foreach_geometry_element_zone(), for_foreach_geometry_element_zone(), for_group_node(), for_modifier(), for_modifier(), for_operator(), for_operator(), for_repeat_zone(), for_repeat_zone(), for_simulation_zone(), and for_simulation_zone().
| const EvaluateClosureComputeContext & blender::bke::ComputeContextCache::for_evaluate_closure | ( | const ComputeContext * | parent, |
| int32_t | node_id, | ||
| const bNodeTree * | tree = nullptr, | ||
| const std::optional< nodes::ClosureSourceLocation > & | closure_source_location = std::nullopt ) |
Definition at line 274 of file compute_contexts.cc.
References for_any_uncached(), and tree.
Referenced by blender::ed::space_node::compute_context_for_closure_evaluation(), and blender::ed::viewer_path::compute_context_for_viewer_path_elem().
| const ForeachGeometryElementZoneComputeContext & blender::bke::ComputeContextCache::for_foreach_geometry_element_zone | ( | const ComputeContext * | parent, |
| const bNode & | output_node, | ||
| int | index ) |
Definition at line 262 of file compute_contexts.cc.
References for_any_uncached(), and bNode::identifier.
| const ForeachGeometryElementZoneComputeContext & blender::bke::ComputeContextCache::for_foreach_geometry_element_zone | ( | const ComputeContext * | parent, |
| int32_t | output_node_id, | ||
| int | index ) |
Definition at line 250 of file compute_contexts.cc.
References for_any_uncached().
Referenced by blender::ed::viewer_path::compute_context_for_viewer_path_elem(), and blender::ed::space_node::compute_context_for_zone().
| const GroupNodeComputeContext & blender::bke::ComputeContextCache::for_group_node | ( | const ComputeContext * | parent, |
| int32_t | node_id, | ||
| const bNodeTree * | tree = nullptr ) |
Definition at line 202 of file compute_contexts.cc.
References for_any_uncached(), and tree.
Referenced by blender::ed::space_node::compute_context_for_closure_evaluation(), blender::ed::space_node::compute_context_for_tree_path(), blender::ed::viewer_path::compute_context_for_viewer_path_elem(), blender::nodes::partial_eval::eval_downstream(), blender::nodes::partial_eval::eval_upstream(), blender::find_side_effect_nodes_for_nested_node(), blender::nodes::gizmos::foreach_gizmo_for_input(), and blender::ed::space_node::get_compute_context_hash_for_node_editor().
| const ModifierComputeContext & blender::bke::ComputeContextCache::for_modifier | ( | const ComputeContext * | parent, |
| const NodesModifierData & | nmd ) |
Definition at line 173 of file compute_contexts.cc.
References for_any_uncached(), NodesModifierData::modifier, and ModifierData::persistent_uid.
Referenced by blender::ed::viewer_path::compute_context_for_viewer_path_elem(), blender::find_side_effect_nodes_for_nested_node(), blender::find_side_effect_nodes_for_viewer_path(), blender::nodes::geo_eval_log::GeoNodesLog::find_viewer_node_log_for_path(), blender::nodes::gizmos::foreach_active_gizmo_exposed_to_modifier(), and blender::ed::space_node::get_node_editor_root_compute_context().
| const ModifierComputeContext & blender::bke::ComputeContextCache::for_modifier | ( | const ComputeContext * | parent, |
| int | modifier_uid ) |
Definition at line 181 of file compute_contexts.cc.
References for_any_uncached().
| const OperatorComputeContext & blender::bke::ComputeContextCache::for_operator | ( | const ComputeContext * | parent | ) |
Definition at line 189 of file compute_contexts.cc.
References for_any_uncached().
Referenced by blender::ed::space_node::get_node_editor_root_compute_context().
| const OperatorComputeContext & blender::bke::ComputeContextCache::for_operator | ( | const ComputeContext * | parent, |
| const bNodeTree & | tree ) |
Definition at line 195 of file compute_contexts.cc.
References for_any_uncached(), and tree.
| const RepeatZoneComputeContext & blender::bke::ComputeContextCache::for_repeat_zone | ( | const ComputeContext * | parent, |
| const bNode & | output_node, | ||
| int | iteration ) |
Definition at line 240 of file compute_contexts.cc.
References for_any_uncached(), and bNode::identifier.
| const RepeatZoneComputeContext & blender::bke::ComputeContextCache::for_repeat_zone | ( | const ComputeContext * | parent, |
| int32_t | output_node_id, | ||
| int | iteration ) |
Definition at line 229 of file compute_contexts.cc.
References for_any_uncached().
Referenced by blender::ed::viewer_path::compute_context_for_viewer_path_elem(), and blender::ed::space_node::compute_context_for_zone().
| const SimulationZoneComputeContext & blender::bke::ComputeContextCache::for_simulation_zone | ( | const ComputeContext * | parent, |
| const bNode & | output_node ) |
Definition at line 220 of file compute_contexts.cc.
References for_any_uncached(), and bNode::identifier.
| const SimulationZoneComputeContext & blender::bke::ComputeContextCache::for_simulation_zone | ( | const ComputeContext * | parent, |
| int | output_node_id ) |
Definition at line 211 of file compute_contexts.cc.
References for_any_uncached().
Referenced by blender::ed::viewer_path::compute_context_for_viewer_path_elem(), and blender::ed::space_node::compute_context_for_zone().