|
Blender V5.0
|
#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 88 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_shader(), 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 325 of file compute_contexts.cc.
References for_any_uncached(), and tree.
Referenced by blender::nodes::compute_context_for_closure_evaluation(), blender::ed::viewer_path::compute_context_for_viewer_path_elem(), blender::nodes::find_origin_sockets_through_contexts(), and blender::nodes::find_target_sockets_through_contexts().
| const ForeachGeometryElementZoneComputeContext & blender::bke::ComputeContextCache::for_foreach_geometry_element_zone | ( | const ComputeContext * | parent, |
| const bNode & | output_node, | ||
| int | index ) |
Definition at line 313 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 301 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 253 of file compute_contexts.cc.
References for_any_uncached(), and tree.
Referenced by 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::nodes::find_origin_sockets_through_contexts(), blender::find_side_effect_nodes_for_nested_node(), blender::nodes::find_target_sockets_through_contexts(), 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 217 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 225 of file compute_contexts.cc.
References for_any_uncached().
| const OperatorComputeContext & blender::bke::ComputeContextCache::for_operator | ( | const ComputeContext * | parent | ) |
Definition at line 233 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 239 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 291 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 280 of file compute_contexts.cc.
References for_any_uncached().
Referenced by blender::ed::viewer_path::compute_context_for_viewer_path_elem(), blender::ed::space_node::compute_context_for_zone(), blender::nodes::find_origin_sockets_through_contexts(), and blender::nodes::find_target_sockets_through_contexts().
| const ShaderComputeContext & blender::bke::ComputeContextCache::for_shader | ( | const ComputeContext * | parent, |
| const bNodeTree * | tree ) |
Definition at line 246 of file compute_contexts.cc.
References for_any_uncached(), and tree.
Referenced by blender::ed::space_node::get_node_editor_root_compute_context().
| const SimulationZoneComputeContext & blender::bke::ComputeContextCache::for_simulation_zone | ( | const ComputeContext * | parent, |
| const bNode & | output_node ) |
Definition at line 271 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 262 of file compute_contexts.cc.
References for_any_uncached().
Referenced by blender::ed::viewer_path::compute_context_for_viewer_path_elem(), blender::ed::space_node::compute_context_for_zone(), blender::nodes::find_origin_sockets_through_contexts(), and blender::nodes::find_target_sockets_through_contexts().