|
Blender V5.3
|
#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 29 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 105 of file BKE_compute_context_cache.hh.
References blender::result, and T.
Referenced by for_data_block(), for_evaluate_closure(), for_foreach_geometry_element_zone(), for_foreach_geometry_element_zone(), for_geometry_nodes_modifier(), for_geometry_nodes_modifier(), for_group_node(), for_operator(), for_operator(), for_repeat_zone(), for_repeat_zone(), for_scene_compositor_effect(), for_shader(), for_simulation_zone(), and for_simulation_zone().
| const DataBlockComputeContext & blender::bke::ComputeContextCache::for_data_block | ( | const ComputeContext * | parent, |
| const ID & | id ) |
Definition at line 301 of file compute_contexts.cc.
References blender::DEG_get_original(), blender::DEG_is_original(), and for_data_block().
| const DataBlockComputeContext & blender::bke::ComputeContextCache::for_data_block | ( | const ComputeContext * | parent, |
| const uint32_t | orig_session_uid, | ||
| const ID * | id = nullptr ) |
Definition at line 292 of file compute_contexts.cc.
References for_any_uncached().
Referenced by blender::ed::viewer_path::compute_context_for_viewer_path_elem(), blender::bke::compositor::compute_viewer_compute_context(), blender::bke::compositor::compute_viewer_compute_context(), blender::seq::CompositorEffectContext::evaluate(), blender::seq::CompositorModifierContext::evaluate(), blender::compositor::SceneCompositorEffectsOperation::execute(), blender::find_side_effect_nodes_for_nested_node(), blender::find_side_effect_nodes_for_viewer_path(), blender::nodes::eval_log::NodesEvalLog::find_viewer_node_log_for_path(), for_data_block(), blender::nodes::gizmos::foreach_active_gizmo_exposed_to_modifier(), and blender::ed::space_node::get_node_editor_root_compute_context().
| 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 432 of file compute_contexts.cc.
References for_any_uncached().
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 420 of file compute_contexts.cc.
References for_any_uncached(), and blender::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 408 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 GeometryNodesModifierComputeContext & blender::bke::ComputeContextCache::for_geometry_nodes_modifier | ( | const ComputeContext * | parent, |
| const NodesModifierData & | nmd ) |
Definition at line 314 of file compute_contexts.cc.
References for_any_uncached(), blender::NodesModifierData::modifier, and blender::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::eval_log::NodesEvalLog::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 GeometryNodesModifierComputeContext & blender::bke::ComputeContextCache::for_geometry_nodes_modifier | ( | const ComputeContext * | parent, |
| int | modifier_uid ) |
Definition at line 322 of file compute_contexts.cc.
References for_any_uncached().
| const GroupNodeComputeContext & blender::bke::ComputeContextCache::for_group_node | ( | const ComputeContext * | parent, |
| int32_t | node_id, | ||
| const bNodeTree * | tree = nullptr ) |
Definition at line 360 of file compute_contexts.cc.
References for_any_uncached().
Referenced by blender::ed::space_node::compute_context_for_tree_path(), blender::ed::viewer_path::compute_context_for_viewer_path_elem(), blender::bke::compositor::compute_viewer_compute_context_recursive(), 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(), blender::ed::space_node::get_compute_context_hash_for_node_editor(), and blender::compositor::has_viewer_node().
| const OperatorComputeContext & blender::bke::ComputeContextCache::for_operator | ( | const ComputeContext * | parent | ) |
Definition at line 340 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 346 of file compute_contexts.cc.
References for_any_uncached().
| const RepeatZoneComputeContext & blender::bke::ComputeContextCache::for_repeat_zone | ( | const ComputeContext * | parent, |
| const bNode & | output_node, | ||
| int | iteration ) |
Definition at line 398 of file compute_contexts.cc.
References for_any_uncached(), and blender::bNode::identifier.
| const RepeatZoneComputeContext & blender::bke::ComputeContextCache::for_repeat_zone | ( | const ComputeContext * | parent, |
| int32_t | output_node_id, | ||
| int | iteration ) |
Definition at line 387 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::compositor::RepeatZoneOperation::execute(), blender::nodes::find_origin_sockets_through_contexts(), blender::nodes::find_target_sockets_through_contexts(), and blender::bke::compositor::get_zone_viewer_compute_context().
| const SceneCompositorEffectComputeContext & blender::bke::ComputeContextCache::for_scene_compositor_effect | ( | const ComputeContext * | parent, |
| const SceneCompositorEffect & | effect ) |
Definition at line 331 of file compute_contexts.cc.
References for_any_uncached(), and blender::SceneCompositorEffect::name.
Referenced by blender::bke::compositor::compute_viewer_compute_context(), blender::compositor::SceneCompositorEffectsOperation::execute(), and blender::ed::space_node::get_node_editor_root_compute_context().
| const ShaderComputeContext & blender::bke::ComputeContextCache::for_shader | ( | const ComputeContext * | parent, |
| const bNodeTree * | tree ) |
Definition at line 353 of file compute_contexts.cc.
References for_any_uncached().
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 378 of file compute_contexts.cc.
References for_any_uncached(), and blender::bNode::identifier.
| const SimulationZoneComputeContext & blender::bke::ComputeContextCache::for_simulation_zone | ( | const ComputeContext * | parent, |
| int | output_node_id ) |
Definition at line 369 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().