Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-06-14 16:33:41 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-06-14 17:04:09 +0300
commit00eeb05f4c0bf233dfa80a5c7f9b154046521afc (patch)
treea99ce285f4a96ec5b235c15703c62e1da79f9314 /source/blender/depsgraph/intern/nodes
parent42d887201465f24a43f320e20c9fba42a6e71b19 (diff)
Depsgraph: Make certain components NOT tag copy-on-write when they are tagged
Currently done for mesh batch cache update, and for base flags sync. Those components do not need anything from original object, and hence can skip CoW tag and have faster update after them used.
Diffstat (limited to 'source/blender/depsgraph/intern/nodes')
-rw-r--r--source/blender/depsgraph/intern/nodes/deg_node_component.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/source/blender/depsgraph/intern/nodes/deg_node_component.h b/source/blender/depsgraph/intern/nodes/deg_node_component.h
index 7338a99dfcb..5e79dc1c685 100644
--- a/source/blender/depsgraph/intern/nodes/deg_node_component.h
+++ b/source/blender/depsgraph/intern/nodes/deg_node_component.h
@@ -144,8 +144,12 @@ struct ComponentDepsNode : public DepsNode {
OperationDepsNode *entry_operation;
OperationDepsNode *exit_operation;
- // XXX: a poll() callback to check if component's first node can be started?
virtual bool depends_on_cow() { return true; }
+
+ /* Denotes whether COW component is to be tagged when this component
+ * is tagged for update.
+ */
+ virtual bool need_tag_cow_before_update() { return true; }
};
/* ---------------------------------------- */
@@ -168,8 +172,14 @@ struct ComponentDepsNode : public DepsNode {
DEG_COMPONENT_NODE_DECLARE; \
}
+#define DEG_COMPONENT_NODE_DECLARE_NO_COW_TAG_ON_UPDATE(name) \
+ struct name ## ComponentDepsNode : public ComponentDepsNode { \
+ DEG_COMPONENT_NODE_DECLARE; \
+ virtual bool need_tag_cow_before_update() { return false; } \
+ }
+
DEG_COMPONENT_NODE_DECLARE_GENERIC(Animation);
-DEG_COMPONENT_NODE_DECLARE_GENERIC(BatchCache);
+DEG_COMPONENT_NODE_DECLARE_NO_COW_TAG_ON_UPDATE(BatchCache);
DEG_COMPONENT_NODE_DECLARE_GENERIC(Cache);
DEG_COMPONENT_NODE_DECLARE_GENERIC(CopyOnWrite);
DEG_COMPONENT_NODE_DECLARE_GENERIC(Geometry);
@@ -182,7 +192,7 @@ DEG_COMPONENT_NODE_DECLARE_GENERIC(Sequencer);
DEG_COMPONENT_NODE_DECLARE_GENERIC(Shading);
DEG_COMPONENT_NODE_DECLARE_GENERIC(ShadingParameters);
DEG_COMPONENT_NODE_DECLARE_GENERIC(Transform);
-DEG_COMPONENT_NODE_DECLARE_GENERIC(ObjectFromLayer);
+DEG_COMPONENT_NODE_DECLARE_NO_COW_TAG_ON_UPDATE(ObjectFromLayer);
/* Bone Component */
struct BoneComponentDepsNode : public ComponentDepsNode {