[Bf-blender-cvs] [84be763] master: Depsgraph: Merge some traversal back on

Sergey Sharybin noreply at git.blender.org
Thu Aug 25 16:11:42 CEST 2016


Commit: 84be763be299572eb98a7fbf3b87c27408c57984
Author: Sergey Sharybin
Date:   Thu Aug 25 15:51:19 2016 +0200
Branches: master
https://developer.blender.org/rB84be763be299572eb98a7fbf3b87c27408c57984

Depsgraph: Merge some traversal back on

After previous commit there is no longer measurable difference
in speed and doing all stuff in one go is preferrable here anyway.

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

M	source/blender/depsgraph/intern/eval/deg_eval_flush.cc

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

diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
index 98d8c60..a7418ac 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
@@ -136,6 +136,42 @@ void deg_graph_flush_updates(Main *bmain, Depsgraph *graph)
 
 			ComponentDepsNode *comp_node = node->owner;
 			IDDepsNode *id_node = comp_node->owner;
+
+			ID *id = id_node->id;
+			if(id_node->done == 0) {
+				deg_editors_id_update(bmain, id);
+				lib_id_recalc_tag(bmain, id);
+				/* TODO(sergey): For until we've got proper data nodes in the graph. */
+				lib_id_recalc_data_tag(bmain, id);
+			}
+
+			if(comp_node->done == 0) {
+				Object *object = NULL;
+				if (GS(id->name) == ID_OB) {
+					object = (Object *)id;
+				}
+				foreach (OperationDepsNode *op, comp_node->operations) {
+					op->flag |= DEPSOP_FLAG_NEEDS_UPDATE;
+				}
+				if (object != NULL) {
+					/* This code is used to preserve those areas which does
+					 * direct object update,
+					 *
+					 * Plus it ensures visibility changes and relations and
+					 * layers visibility update has proper flags to work with.
+					 */
+					if (comp_node->type == DEPSNODE_TYPE_ANIMATION) {
+						object->recalc |= OB_RECALC_TIME;
+					}
+					else if (comp_node->type == DEPSNODE_TYPE_TRANSFORM) {
+						object->recalc |= OB_RECALC_OB;
+					}
+					else {
+						object->recalc |= OB_RECALC_DATA;
+					}
+				}
+			}
+
 			id_node->done = 1;
 			comp_node->done = 1;
 
@@ -162,52 +198,6 @@ void deg_graph_flush_updates(Main *bmain, Depsgraph *graph)
 			}
 		}
 	}
-
-	GHASH_FOREACH_BEGIN(DEG::IDDepsNode *, id_node, graph->id_hash)
-	{
-		if (id_node->done == 1) {
-			ID *id = id_node->id;
-			Object *object = NULL;
-
-			if (GS(id->name) == ID_OB) {
-				object = (Object *)id;
-			}
-
-			deg_editors_id_update(bmain, id_node->id);
-
-			lib_id_recalc_tag(bmain, id_node->id);
-			/* TODO(sergey): For until we've got proper data nodes in the graph. */
-			lib_id_recalc_data_tag(bmain, id_node->id);
-
-			GHASH_FOREACH_BEGIN(const ComponentDepsNode *, comp_node, id_node->components)
-			{
-				if (comp_node->done) {
-					foreach (OperationDepsNode *op, comp_node->operations) {
-						op->flag |= DEPSOP_FLAG_NEEDS_UPDATE;
-					}
-					if (object != NULL) {
-						/* This code is used to preserve those areas which does
-						 * direct object update,
-						 *
-						 * Plus it ensures visibility changes and relations and
-						 * layers visibility update has proper flags to work with.
-						 */
-						if (comp_node->type == DEPSNODE_TYPE_ANIMATION) {
-							object->recalc |= OB_RECALC_TIME;
-						}
-						else if (comp_node->type == DEPSNODE_TYPE_TRANSFORM) {
-							object->recalc |= OB_RECALC_OB;
-						}
-						else {
-							object->recalc |= OB_RECALC_DATA;
-						}
-					}
-				}
-			}
-			GHASH_FOREACH_END();
-		}
-	}
-	GHASH_FOREACH_END();
 }
 
 static void graph_clear_func(void *data_v, int i)




More information about the Bf-blender-cvs mailing list