[Bf-blender-cvs] [d92bca186fa] blender2.8: Depsgraph: Initialize depsgraph as need for update

Sergey Sharybin noreply at git.blender.org
Tue Oct 24 13:55:55 CEST 2017


Commit: d92bca186facdb3d2810527c086c9160352a884b
Author: Sergey Sharybin
Date:   Tue Oct 24 13:54:12 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBd92bca186facdb3d2810527c086c9160352a884b

Depsgraph: Initialize depsgraph as need for update

This way we can delay graph allocation and relations update.

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

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

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

diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc
index a20a0c2bb31..8f9f9182bc6 100644
--- a/source/blender/depsgraph/intern/depsgraph.cc
+++ b/source/blender/depsgraph/intern/depsgraph.cc
@@ -82,7 +82,7 @@ static DEG_EditorUpdateScenePreCb deg_editor_update_scene_pre_cb = NULL;
 
 Depsgraph::Depsgraph()
   : time_source(NULL),
-    need_update(false)
+    need_update(true)
 {
 	BLI_spin_init(&lock);
 	id_hash = BLI_ghash_ptr_new("Depsgraph id hash");
diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc
index e4b6434b9c7..42ccd806dc8 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build.cc
@@ -245,6 +245,9 @@ void DEG_graph_build_from_scene(Depsgraph *graph, Main *bmain, Scene *scene)
 #ifdef DEBUG_TIME
 	TIMEIT_END(DEG_graph_build_from_scene);
 #endif
+
+	/* Relations are up to date. */
+	deg_graph->need_update = false;
 }
 
 /* Tag graph relations for update. */
@@ -290,8 +293,6 @@ void DEG_scene_relations_update(Main *bmain, Scene *scene)
 	DEG_graph_build_from_scene(reinterpret_cast< ::Depsgraph * >(graph),
 	                           bmain,
 	                           scene);
-
-	graph->need_update = false;
 }
 
 /* Rebuild dependency graph only for a given scene. */



More information about the Bf-blender-cvs mailing list