[Bf-blender-cvs] [43533076073] blender2.8: Depsgraph: Make validation to take explicit graph to be checked

Sergey Sharybin noreply at git.blender.org
Wed Oct 25 14:51:21 CEST 2017


Commit: 43533076073dcbac04f1b59fb2b4a519a2755aee
Author: Sergey Sharybin
Date:   Wed Oct 25 14:51:02 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB43533076073dcbac04f1b59fb2b4a519a2755aee

Depsgraph: Make validation to take explicit graph to be checked

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

M	source/blender/blenkernel/intern/scene.c
M	source/blender/depsgraph/DEG_depsgraph_debug.h
M	source/blender/depsgraph/intern/depsgraph_debug.cc

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

diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 20611c18a5c..72a953627ca 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -99,6 +99,7 @@
 
 #include "DEG_depsgraph.h"
 #include "DEG_depsgraph_build.h"
+#include "DEG_depsgraph_debug.h"
 #include "DEG_depsgraph_query.h"
 
 #include "RE_engine.h"
@@ -1590,10 +1591,9 @@ void BKE_scene_update_tagged(EvaluationContext *eval_ctx, Main *bmain, Scene *sc
 {
 	/* (re-)build dependency graph if needed */
 	DEG_scene_relations_update(bmain, scene);
+
 	/* Uncomment this to check if graph was properly tagged for update. */
-#if 0
-	DEG_scene_relations_validate(bmain, scene);
-#endif
+	// DEG_debug_graph_relations_validate(scene->depsgraph_legacy, bmain, scene);
 
 	/* flush editing data if needed */
 	prepare_mesh_for_viewport_render(bmain, scene);
diff --git a/source/blender/depsgraph/DEG_depsgraph_debug.h b/source/blender/depsgraph/DEG_depsgraph_debug.h
index 63ebe21d073..7546f1d9018 100644
--- a/source/blender/depsgraph/DEG_depsgraph_debug.h
+++ b/source/blender/depsgraph/DEG_depsgraph_debug.h
@@ -60,7 +60,8 @@ bool DEG_debug_compare(const struct Depsgraph *graph1,
                        const struct Depsgraph *graph2);
 
 /* Check that dependnecies in the graph are really up to date. */
-bool DEG_debug_scene_relations_validate(struct Main *bmain,
+bool DEG_debug_graph_relations_validate(struct Depsgraph *graph,
+                                        struct Main *bmain,
                                         struct Scene *scene);
 
 
diff --git a/source/blender/depsgraph/intern/depsgraph_debug.cc b/source/blender/depsgraph/intern/depsgraph_debug.cc
index 8db8eb32b34..70e08dbb449 100644
--- a/source/blender/depsgraph/intern/depsgraph_debug.cc
+++ b/source/blender/depsgraph/intern/depsgraph_debug.cc
@@ -64,18 +64,19 @@ bool DEG_debug_compare(const struct Depsgraph *graph1,
 	return true;
 }
 
-bool DEG_debug_scene_relations_validate(Main *bmain,
+bool DEG_debug_graph_relations_validate(Depsgraph *graph,
+                                        Main *bmain,
                                         Scene *scene)
 {
-	Depsgraph *depsgraph = DEG_graph_new();
+	Depsgraph *temp_depsgraph = DEG_graph_new();
 	bool valid = true;
-	DEG_graph_build_from_scene(depsgraph, bmain, scene);
-	if (!DEG_debug_compare(depsgraph, scene->depsgraph_legacy)) {
+	DEG_graph_build_from_scene(temp_depsgraph, bmain, scene);
+	if (!DEG_debug_compare(temp_depsgraph, graph)) {
 		fprintf(stderr, "ERROR! Depsgraph wasn't tagged for update when it should have!\n");
 		BLI_assert(!"This should not happen!");
 		valid = false;
 	}
-	DEG_graph_free(depsgraph);
+	DEG_graph_free(temp_depsgraph);
 	return valid;
 }



More information about the Bf-blender-cvs mailing list