diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-10-25 15:51:02 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-10-25 15:51:02 +0300 |
commit | 43533076073dcbac04f1b59fb2b4a519a2755aee (patch) | |
tree | eab4eaf9764c21120130df7a33b260533596e2da /source/blender | |
parent | db83f41bafacb429e8fb24ccc509aa91f5744146 (diff) |
Depsgraph: Make validation to take explicit graph to be checked
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 6 | ||||
-rw-r--r-- | source/blender/depsgraph/DEG_depsgraph_debug.h | 3 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_debug.cc | 11 |
3 files changed, 11 insertions, 9 deletions
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; } |