diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-01-24 13:26:15 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-01-24 14:44:16 +0300 |
commit | cf84db61a6baf160fc3521e5b5a4121609b9ea8d (patch) | |
tree | fb7b233ee0bb78f751b45ac121e7876a2d074d42 /source/blender/depsgraph | |
parent | c89e103348414feb3396c7b10abb594c77d8c333 (diff) |
Depsgraph: Refactor, move debug struct to own file
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r-- | source/blender/depsgraph/intern/debug/deg_debug.cc | 4 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/debug/deg_debug.h | 11 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph.cc | 1 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph.h | 10 |
4 files changed, 17 insertions, 9 deletions
diff --git a/source/blender/depsgraph/intern/debug/deg_debug.cc b/source/blender/depsgraph/intern/debug/deg_debug.cc index b811f11f721..b8db18c9958 100644 --- a/source/blender/depsgraph/intern/debug/deg_debug.cc +++ b/source/blender/depsgraph/intern/debug/deg_debug.cc @@ -32,6 +32,10 @@ namespace DEG { +DepsgraphDebug::DepsgraphDebug() : flags(G.debug) +{ +} + bool terminal_do_color(void) { return (G.debug & G_DEBUG_DEPSGRAPH_PRETTY) != 0; diff --git a/source/blender/depsgraph/intern/debug/deg_debug.h b/source/blender/depsgraph/intern/debug/deg_debug.h index 3e4da644641..90a2f7a25fd 100644 --- a/source/blender/depsgraph/intern/debug/deg_debug.h +++ b/source/blender/depsgraph/intern/debug/deg_debug.h @@ -31,6 +31,17 @@ namespace DEG { +struct DepsgraphDebug { + DepsgraphDebug(); + + /* NOTE: Corresponds to G_DEBUG_DEPSGRAPH_* flags. */ + int flags; + + /* Name of this dependency graph (is used for debug prints, helping to distinguish graphs + * created for different view layer). */ + string name; +}; + #define DEG_DEBUG_PRINTF(depsgraph, type, ...) \ do { \ if (DEG_debug_flags_get(depsgraph) & G_DEBUG_DEPSGRAPH_##type) { \ diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc index 0e929f4e8b6..7e26857e440 100644 --- a/source/blender/depsgraph/intern/depsgraph.cc +++ b/source/blender/depsgraph/intern/depsgraph.cc @@ -83,7 +83,6 @@ Depsgraph::Depsgraph(Main *bmain, Scene *scene, ViewLayer *view_layer, eEvaluati BLI_spin_init(&lock); id_hash = BLI_ghash_ptr_new("Depsgraph id hash"); entry_tags = BLI_gset_ptr_new("Depsgraph entry_tags"); - debug.flags = G.debug; memset(id_type_updated, 0, sizeof(id_type_updated)); memset(id_type_exist, 0, sizeof(id_type_exist)); memset(physics_relations, 0, sizeof(physics_relations)); diff --git a/source/blender/depsgraph/intern/depsgraph.h b/source/blender/depsgraph/intern/depsgraph.h index 89c5af9c798..a7ee5612af4 100644 --- a/source/blender/depsgraph/intern/depsgraph.h +++ b/source/blender/depsgraph/intern/depsgraph.h @@ -40,6 +40,7 @@ #include "DEG_depsgraph.h" #include "DEG_depsgraph_physics.h" +#include "intern/debug/deg_debug.h" #include "intern/depsgraph_type.h" struct GHash; @@ -156,14 +157,7 @@ struct Depsgraph { * to read stuff from. */ bool is_active; - struct { - /* NOTE: Corresponds to G_DEBUG_DEPSGRAPH_* flags. */ - int flags; - - /* Name of this dependency graph (is used for debug prints, helping to distinguish graphs - * created for different view layer). */ - string name; - } debug; + DepsgraphDebug debug; bool is_evaluating; |