[Bf-blender-cvs] [ea1335e] depsgraph_refactor: Depsgraph: Don't re-tag operations for update

Sergey Sharybin noreply at git.blender.org
Wed Jan 14 14:48:25 CET 2015


Commit: ea1335e7c104ac5cc8853b64ae9f579d5684868c
Author: Sergey Sharybin
Date:   Wed Jan 14 17:30:36 2015 +0500
Branches: depsgraph_refactor
https://developer.blender.org/rBea1335e7c104ac5cc8853b64ae9f579d5684868c

Depsgraph: Don't re-tag operations for update

This way we're saving some time in both tagging (by skipping loop over component operations
which are tagged already) and scene evaluation (because now we don't have redundant entries
in the directly modified operations).

This gives about 30% speedup on loading Koro rig file.

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

M	source/blender/depsgraph/intern/depsnode_component.cpp
M	source/blender/depsgraph/intern/depsnode_operation.cpp

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

diff --git a/source/blender/depsgraph/intern/depsnode_component.cpp b/source/blender/depsgraph/intern/depsnode_component.cpp
index 3d26ecd..fe83b0d 100644
--- a/source/blender/depsgraph/intern/depsnode_component.cpp
+++ b/source/blender/depsgraph/intern/depsnode_component.cpp
@@ -195,6 +195,10 @@ void ComponentDepsNode::clear_operations()
 
 void ComponentDepsNode::tag_update(Depsgraph *graph)
 {
+	OperationDepsNode *entry_op = get_entry_operation();
+	if (entry_op != NULL && entry_op->flag & DEPSOP_FLAG_NEEDS_UPDATE) {
+		return;
+	}
 	for (OperationMap::const_iterator it = operations.begin(); it != operations.end(); ++it) {
 		OperationDepsNode *op_node = it->second;
 		op_node->tag_update(graph);
diff --git a/source/blender/depsgraph/intern/depsnode_operation.cpp b/source/blender/depsgraph/intern/depsnode_operation.cpp
index 5ebce54..3700e74 100644
--- a/source/blender/depsgraph/intern/depsnode_operation.cpp
+++ b/source/blender/depsgraph/intern/depsnode_operation.cpp
@@ -68,9 +68,11 @@ string OperationDepsNode::identifier() const
 
 void OperationDepsNode::tag_update(Depsgraph *graph)
 {
-	/* tag for update, but also note that this was the source of an update */
+	if (flag & DEPSOP_FLAG_NEEDS_UPDATE) {
+		return;
+	}
+	/* Tag for update, but also note that this was the source of an update. */
 	flag |= (DEPSOP_FLAG_NEEDS_UPDATE | DEPSOP_FLAG_DIRECTLY_MODIFIED);
-	
 	graph->add_entry_tag(this);
 }




More information about the Bf-blender-cvs mailing list