[Bf-blender-cvs] [ce2c15d] master: Depsgraph: Avoid multipel editors update per same ID

Sergey Sharybin noreply at git.blender.org
Tue May 10 11:27:37 CEST 2016


Commit: ce2c15deafcb8e2d2b5a8f2b46572fb24c439ce9
Author: Sergey Sharybin
Date:   Tue May 10 11:25:57 2016 +0200
Branches: master
https://developer.blender.org/rBce2c15deafcb8e2d2b5a8f2b46572fb24c439ce9

Depsgraph: Avoid multipel editors update per same ID

Simple thing, and apparently fps goes up to 80 with the demo file from jpbouza.

Not sure why at this point fps is so much higher than the old dependency graph
here now. And it's definitely something what others should verify as well.

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

M	source/blender/depsgraph/intern/depsgraph_tag.cc

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

diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc
index 7c660ca..a433c93 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -282,7 +282,12 @@ void DEG_graph_flush_updates(Main *bmain, Depsgraph *graph)
 	     it != graph->operations.end();
 	     ++it)
 	{
+		/* ID node's done flag is used to avoid multiple editors update
+		 * for the same ID.
+		 */
 		OperationDepsNode *node = *it;
+		IDDepsNode *id_node = node->owner->owner;
+		id_node->done = 0;
 		node->scheduled = false;
 		node->owner->flags &= ~DEPSCOMP_FULLY_SCHEDULED;
 	}
@@ -301,7 +306,10 @@ void DEG_graph_flush_updates(Main *bmain, Depsgraph *graph)
 		OperationDepsNode *node = *it;
 		IDDepsNode *id_node = node->owner->owner;
 		queue.push(node);
-		deg_editors_id_update(bmain, id_node->id);
+		if (id_node->done == 0) {
+			deg_editors_id_update(bmain, id_node->id);
+			id_node->done = 1;
+		}
 		node->scheduled = true;
 	}
 
@@ -346,7 +354,10 @@ void DEG_graph_flush_updates(Main *bmain, Depsgraph *graph)
 				to_node->flag |= DEPSOP_FLAG_NEEDS_UPDATE;
 				queue.push(to_node);
 				to_node->scheduled = true;
-				deg_editors_id_update(bmain, id_node->id);
+				if (id_node->done == 0) {
+					deg_editors_id_update(bmain, id_node->id);
+					id_node->done = 1;
+				}
 			}
 		}




More information about the Bf-blender-cvs mailing list