[Bf-blender-cvs] [835203fde8d] master: Depsgraph: Localize synchronization component visibility handling

Sergey Sharybin noreply at git.blender.org
Tue Jul 19 14:39:51 CEST 2022


Commit: 835203fde8d61014c727bfc9c8aa3d32862f2592
Author: Sergey Sharybin
Date:   Tue Jul 19 14:35:18 2022 +0200
Branches: master
https://developer.blender.org/rB835203fde8d61014c727bfc9c8aa3d32862f2592

Depsgraph: Localize synchronization component visibility handling

Move it from generic visibility handling to the synchronization
component node implementation. Should be no functional changes.

===================================================================

M	source/blender/depsgraph/intern/builder/deg_builder.cc
M	source/blender/depsgraph/intern/node/deg_node_component.h

===================================================================

diff --git a/source/blender/depsgraph/intern/builder/deg_builder.cc b/source/blender/depsgraph/intern/builder/deg_builder.cc
index a3cd821e82f..888e0649065 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder.cc
@@ -138,19 +138,6 @@ void deg_graph_build_flush_visibility(Depsgraph *graph)
   for (IDNode *id_node : graph->id_nodes) {
     for (ComponentNode *comp_node : id_node->components.values()) {
       comp_node->affects_directly_visible |= id_node->is_directly_visible;
-
-      /* Enforce "visibility" of the synchronization component.
-       *
-       * This component is never connected to other ID nodes, and hence can not be handled in the
-       * same way as other components needed for evaluation. It is only needed for proper
-       * evaluation of the ID node it belongs to.
-       *
-       * The design is such that the synchronization is supposed to happen whenever any part of the
-       * ID changed/evaluated. Here we mark the component as "visible" so that genetic recalc flag
-       * flushing and scheduling will handle the component in a generic manner. */
-      if (comp_node->type == NodeType::SYNCHRONIZATION) {
-        comp_node->affects_directly_visible = true;
-      }
     }
   }
 
diff --git a/source/blender/depsgraph/intern/node/deg_node_component.h b/source/blender/depsgraph/intern/node/deg_node_component.h
index ee6c56b1171..fd6af43f40e 100644
--- a/source/blender/depsgraph/intern/node/deg_node_component.h
+++ b/source/blender/depsgraph/intern/node/deg_node_component.h
@@ -195,7 +195,6 @@ DEG_COMPONENT_NODE_DECLARE_GENERIC(ShadingParameters);
 DEG_COMPONENT_NODE_DECLARE_GENERIC(Transform);
 DEG_COMPONENT_NODE_DECLARE_NO_COW_TAG_ON_UPDATE(ObjectFromLayer);
 DEG_COMPONENT_NODE_DECLARE_GENERIC(Dupli);
-DEG_COMPONENT_NODE_DECLARE_GENERIC(Synchronization);
 DEG_COMPONENT_NODE_DECLARE_GENERIC(Audio);
 DEG_COMPONENT_NODE_DECLARE_GENERIC(Armature);
 DEG_COMPONENT_NODE_DECLARE_GENERIC(GenericDatablock);
@@ -203,6 +202,25 @@ DEG_COMPONENT_NODE_DECLARE_NO_COW(Visibility);
 DEG_COMPONENT_NODE_DECLARE_GENERIC(Simulation);
 DEG_COMPONENT_NODE_DECLARE_GENERIC(NTreeOutput);
 
+/* Synchronization Component. */
+struct SynchronizationComponentNode : public ComponentNode {
+  SynchronizationComponentNode()
+  {
+    /* Enforce "visibility" of the synchronization component.
+     *
+     * This component is never connected to other ID nodes, and hence can not be handled in the
+     * same way as other components needed for evaluation. It is only needed for proper
+     * evaluation of the ID node it belongs to.
+     *
+     * The design is such that the synchronization is supposed to happen whenever any part of the
+     * ID changed/evaluated. Here we mark the component as "visible" so that genetic recalc flag
+     * flushing and scheduling will handle the component in a generic manner. */
+    affects_directly_visible = true;
+  }
+
+  DEG_COMPONENT_NODE_DECLARE;
+};
+
 /* Bone Component */
 struct BoneComponentNode : public ComponentNode {
   /** Initialize 'bone component' node - from pointer data given. */



More information about the Bf-blender-cvs mailing list