diff options
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_debug.cc')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_debug.cc | 46 |
1 files changed, 40 insertions, 6 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_debug.cc b/source/blender/depsgraph/intern/depsgraph_debug.cc index b7bf63e0cb0..f7adaafe5b3 100644 --- a/source/blender/depsgraph/intern/depsgraph_debug.cc +++ b/source/blender/depsgraph/intern/depsgraph_debug.cc @@ -37,16 +37,48 @@ extern "C" { #include "DNA_scene_types.h" } /* extern "C" */ +#include "DNA_object_types.h" + #include "DEG_depsgraph.h" #include "DEG_depsgraph_debug.h" #include "DEG_depsgraph_build.h" +#include "DEG_depsgraph_query.h" #include "intern/depsgraph_intern.h" +#include "intern/depsgraph_types.h" #include "intern/nodes/deg_node_id.h" #include "intern/nodes/deg_node_time.h" #include "util/deg_util_foreach.h" +void DEG_debug_flags_set(Depsgraph *depsgraph, int flags) +{ + DEG::Depsgraph *deg_graph = + reinterpret_cast<DEG::Depsgraph *>(depsgraph); + deg_graph->debug_flags = flags; +} + +int DEG_debug_flags_get(const Depsgraph *depsgraph) +{ + const DEG::Depsgraph *deg_graph = + reinterpret_cast<const DEG::Depsgraph *>(depsgraph); + return deg_graph->debug_flags; +} + +void DEG_debug_name_set(struct Depsgraph *depsgraph, const char *name) +{ + DEG::Depsgraph *deg_graph = + reinterpret_cast<DEG::Depsgraph *>(depsgraph); + deg_graph->debug_name = name; +} + +const char *DEG_debug_name_get(struct Depsgraph *depsgraph) +{ + const DEG::Depsgraph *deg_graph = + reinterpret_cast<const DEG::Depsgraph *>(depsgraph); + return deg_graph->debug_name.c_str(); +} + bool DEG_debug_compare(const struct Depsgraph *graph1, const struct Depsgraph *graph2) { @@ -67,18 +99,20 @@ bool DEG_debug_compare(const struct Depsgraph *graph1, return true; } -bool DEG_debug_scene_relations_validate(Main *bmain, - Scene *scene) +bool DEG_debug_graph_relations_validate(Depsgraph *graph, + Main *bmain, + Scene *scene, + ViewLayer *view_layer) { - Depsgraph *depsgraph = DEG_graph_new(); + Depsgraph *temp_depsgraph = DEG_graph_new(scene, view_layer, DEG_get_mode(graph)); bool valid = true; - DEG_graph_build_from_scene(depsgraph, bmain, scene); - if (!DEG_debug_compare(depsgraph, scene->depsgraph)) { + DEG_graph_build_from_view_layer(temp_depsgraph, bmain, scene, view_layer); + 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; } |