[Bf-blender-cvs] [3401b070b8d] master: Depsgraph: Refactor, wrap debug fields into own structure

Sergey Sharybin noreply at git.blender.org
Fri Jan 24 12:44:30 CET 2020


Commit: 3401b070b8d06446449b67b3088dfbc8e507c9b8
Author: Sergey Sharybin
Date:   Fri Jan 24 10:55:39 2020 +0100
Branches: master
https://developer.blender.org/rB3401b070b8d06446449b67b3088dfbc8e507c9b8

Depsgraph: Refactor, wrap debug fields into own structure

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

M	source/blender/depsgraph/intern/depsgraph.cc
M	source/blender/depsgraph/intern/depsgraph.h
M	source/blender/depsgraph/intern/depsgraph_debug.cc

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

diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc
index 292c3b361d8..190ff4e929f 100644
--- a/source/blender/depsgraph/intern/depsgraph.cc
+++ b/source/blender/depsgraph/intern/depsgraph.cc
@@ -82,7 +82,7 @@ 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;
+  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 43829f4e045..71603334530 100644
--- a/source/blender/depsgraph/intern/depsgraph.h
+++ b/source/blender/depsgraph/intern/depsgraph.h
@@ -194,9 +194,14 @@ struct Depsgraph {
    * to read stuff from. */
   bool is_active;
 
-  /* NOTE: Corresponds to G_DEBUG_DEPSGRAPH_* flags. */
-  int debug_flags;
-  string debug_name;
+  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;
 
   bool is_evaluating;
 
diff --git a/source/blender/depsgraph/intern/depsgraph_debug.cc b/source/blender/depsgraph/intern/depsgraph_debug.cc
index bb60db5209c..51267491458 100644
--- a/source/blender/depsgraph/intern/depsgraph_debug.cc
+++ b/source/blender/depsgraph/intern/depsgraph_debug.cc
@@ -47,25 +47,25 @@ extern "C" {
 void DEG_debug_flags_set(Depsgraph *depsgraph, int flags)
 {
   DEG::Depsgraph *deg_graph = reinterpret_cast<DEG::Depsgraph *>(depsgraph);
-  deg_graph->debug_flags = flags;
+  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;
+  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;
+  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();
+  return deg_graph->debug.name.c_str();
 }
 
 bool DEG_debug_compare(const struct Depsgraph *graph1, const struct Depsgraph *graph2)



More information about the Bf-blender-cvs mailing list