Depsgrapgh: Use more distinctive opcode for texture and image evaluation
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 5 Dec 2018 16:13:26 +0000 (17:13 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 5 Dec 2018 16:35:48 +0000 (17:35 +0100)
source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc
source/blender/depsgraph/intern/depsgraph_type_defines.cc
source/blender/depsgraph/intern/depsgraph_types.h
source/blender/depsgraph/intern/nodes/deg_node_component.cc
source/blender/depsgraph/intern/nodes/deg_node_component.h

index d1837e7a69add1d77cc2361725c9b0595a5bf4a2..3fcaa12f03607086ab59274d181319308d2e82e9 100644 (file)
@@ -1534,23 +1534,20 @@ void DepsgraphNodeBuilder::build_texture(Tex *texture)
                        build_image(texture->ima);
                }
        }
-       /* Placeholder so we can add relations and tag ID node for update. */
        add_operation_node(&texture->id,
-                          DEG_NODE_TYPE_PARAMETERS,
+                          DEG_NODE_TYPE_GENERIC_DATABLOCK,
                           NULL,
-                          DEG_OPCODE_PLACEHOLDER);
+                          DEG_OPCODE_GENERIC_DATABLOCK_UPDATE);
 }
 
 void DepsgraphNodeBuilder::build_image(Image *image) {
        if (built_map_.checkIsBuiltAndTag(image)) {
                return;
        }
-       /* Placeholder so we can add relations and tag ID node for update. */
        add_operation_node(&image->id,
-                          DEG_NODE_TYPE_PARAMETERS,
+                          DEG_NODE_TYPE_GENERIC_DATABLOCK,
                           NULL,
-                          DEG_OPCODE_PLACEHOLDER,
-                          "Image Eval");
+                          DEG_OPCODE_GENERIC_DATABLOCK_UPDATE);
 }
 
 void DepsgraphNodeBuilder::build_compositor(Scene *scene)
index 55eaf314a0a74becbb59902b31be034021e17ce8..15744ff614f6933858a147478b0c12e5e2abb4ad 100644 (file)
@@ -422,6 +422,7 @@ static void deg_debug_graphviz_node(const DebugContext &ctx,
                case DEG_NODE_TYPE_BATCH_CACHE:
                case DEG_NODE_TYPE_DUPLI:
                case DEG_NODE_TYPE_SYNCHRONIZE:
+               case DEG_NODE_TYPE_GENERIC_DATABLOCK:
                {
                        ComponentDepsNode *comp_node = (ComponentDepsNode *)node;
                        if (!comp_node->operations.empty()) {
index d93882a71704390ac24c3a628413d1913089ded2..4edf616961cef9d373a4ace30d721c04fa891a66 100644 (file)
@@ -106,6 +106,8 @@ const char *nodeTypeAsString(eDepsNode_Type type)
                STRINGIFY_TYPE(DUPLI);
                /* Synchronization. */
                STRINGIFY_TYPE(SYNCHRONIZE);
+               /* Generic datablock. */
+               STRINGIFY_TYPE(GENERIC_DATABLOCK);
 
                /* Total number of meaningful node types. */
                case NUM_DEG_NODE_TYPES: return "SpecialCase";
@@ -184,6 +186,8 @@ const char *operationCodeAsString(eDepsOperation_Code opcode)
                STRINGIFY_OPCODE(MOVIECLIP_SELECT_UPDATE);
                /* Synchronization. */
                STRINGIFY_OPCODE(SYNCHRONIZE_TO_ORIGINAL);
+               /* Generic datablock. */
+               STRINGIFY_OPCODE(GENERIC_DATABLOCK_UPDATE);
 
                case DEG_NUM_OPCODES: return "SpecialCase";
 #undef STRINGIFY_OPCODE
index 61a91c139137a80294dca3fa6069b61562f630e9..2de614ff8ad96c1d34555d5f3be08a8889ee34fd 100644 (file)
@@ -138,6 +138,9 @@ typedef enum eDepsNode_Type {
         * changed in view layer.
         */
        DEG_NODE_TYPE_OBJECT_FROM_LAYER,
+       /* Un-interestying datablock, which is a part of dependency graph, but does
+        * not have very distinctive update procedure.  */
+       DEG_NODE_TYPE_GENERIC_DATABLOCK,
 
        /* **** Evaluation-Related Outer Types (with Subdata) **** */
 
@@ -292,6 +295,9 @@ typedef enum eDepsOperation_Code {
        /* Synchronization clips. ----------------------------------------------- */
        DEG_OPCODE_SYNCHRONIZE_TO_ORIGINAL,
 
+       /* Generic datablock ---------------------------------------------------- */
+       DEG_OPCODE_GENERIC_DATABLOCK_UPDATE,
+
        DEG_NUM_OPCODES,
 } eDepsOperation_Code;
 const char *operationCodeAsString(eDepsOperation_Code opcode);
index c1c5899db37ec32038a11473675d407dd1791c4c..dc4661cef53ddd5659ffde05e13ded8a5d696d4b 100644 (file)
@@ -402,6 +402,7 @@ DEG_COMPONENT_NODE_DEFINE(Transform,         TRANSFORM,          ID_RECALC_TRANS
 DEG_COMPONENT_NODE_DEFINE(ObjectFromLayer,   OBJECT_FROM_LAYER,  ID_RECALC);
 DEG_COMPONENT_NODE_DEFINE(Dupli,             DUPLI,              0);
 DEG_COMPONENT_NODE_DEFINE(Synchronize,       SYNCHRONIZE,        0);
+DEG_COMPONENT_NODE_DEFINE(GenericDatablock,  GENERIC_DATABLOCK,  0);
 
 /* Node Types Register =================================== */
 
@@ -426,6 +427,7 @@ void deg_register_component_depsnodes()
        deg_register_node_typeinfo(&DNTI_OBJECT_FROM_LAYER);
        deg_register_node_typeinfo(&DNTI_DUPLI);
        deg_register_node_typeinfo(&DNTI_SYNCHRONIZE);
+       deg_register_node_typeinfo(&DNTI_GENERIC_DATABLOCK);
 }
 
 }  // namespace DEG
index f1ad320895210479c41be1bebbac79e7281e91b9..0852d886ae43efdd9c5645662ea6adcd700186d8 100644 (file)
@@ -201,6 +201,7 @@ 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(Synchronize);
+DEG_COMPONENT_NODE_DECLARE_GENERIC(GenericDatablock);
 
 /* Bone Component */
 struct BoneComponentDepsNode : public ComponentDepsNode {