[Bf-blender-cvs] [b95d6983b7d] temp-T78835: Depsgraph: Add command line argument to debug UUIDs

Sergey Sharybin noreply at git.blender.org
Thu Jul 30 15:44:36 CEST 2020


Commit: b95d6983b7df3e7f3ea410b6fdc067cab2df86c0
Author: Sergey Sharybin
Date:   Thu Jul 30 12:29:19 2020 +0200
Branches: temp-T78835
https://developer.blender.org/rBb95d6983b7df3e7f3ea410b6fdc067cab2df86c0

Depsgraph: Add command line argument to debug UUIDs

Will trigger code paths which makes sure UUIDs are generated and
are unique.

Enabled with --debug-depsgraph-uuid (which is also implied by
--debug-depsgraph).

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

M	source/blender/blenkernel/BKE_global.h
M	source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
M	source/creator/creator_args.c

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

diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h
index 61c270202f1..a356ad56994 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -145,18 +145,19 @@ enum {
   G_DEBUG_DEPSGRAPH_TIME = (1 << 11),       /* depsgraph timing statistics and messages */
   G_DEBUG_DEPSGRAPH_NO_THREADS = (1 << 12), /* single threaded depsgraph */
   G_DEBUG_DEPSGRAPH_PRETTY = (1 << 13),     /* use pretty colors in depsgraph messages */
+  G_DEBUG_DEPSGRAPH_UUID = (1 << 14),       /* use pretty colors in depsgraph messages */
   G_DEBUG_DEPSGRAPH = (G_DEBUG_DEPSGRAPH_BUILD | G_DEBUG_DEPSGRAPH_EVAL | G_DEBUG_DEPSGRAPH_TAG |
-                       G_DEBUG_DEPSGRAPH_TIME),
-  G_DEBUG_SIMDATA = (1 << 14),               /* sim debug data display */
-  G_DEBUG_GPU_MEM = (1 << 15),               /* gpu memory in status bar */
-  G_DEBUG_GPU = (1 << 16),                   /* gpu debug */
-  G_DEBUG_IO = (1 << 17),                    /* IO Debugging (for Collada, ...)*/
-  G_DEBUG_GPU_SHADERS = (1 << 18),           /* GLSL shaders */
-  G_DEBUG_GPU_FORCE_WORKAROUNDS = (1 << 19), /* force gpu workarounds bypassing detections. */
-  G_DEBUG_XR = (1 << 20),                    /* XR/OpenXR messages */
-  G_DEBUG_XR_TIME = (1 << 21),               /* XR/OpenXR timing messages */
-
-  G_DEBUG_GHOST = (1 << 20), /* Debug GHOST module. */
+                       G_DEBUG_DEPSGRAPH_TIME | G_DEBUG_DEPSGRAPH_UUID),
+  G_DEBUG_SIMDATA = (1 << 15),               /* sim debug data display */
+  G_DEBUG_GPU_MEM = (1 << 16),               /* gpu memory in status bar */
+  G_DEBUG_GPU = (1 << 17),                   /* gpu debug */
+  G_DEBUG_IO = (1 << 18),                    /* IO Debugging (for Collada, ...)*/
+  G_DEBUG_GPU_SHADERS = (1 << 19),           /* GLSL shaders */
+  G_DEBUG_GPU_FORCE_WORKAROUNDS = (1 << 20), /* force gpu workarounds bypassing detections. */
+  G_DEBUG_XR = (1 << 21),                    /* XR/OpenXR messages */
+  G_DEBUG_XR_TIME = (1 << 22),               /* XR/OpenXR timing messages */
+
+  G_DEBUG_GHOST = (1 << 23), /* Debug GHOST module. */
 };
 
 #define G_DEBUG_ALL \
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
index e2837b97c1e..c0a3bf1b78d 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
@@ -309,6 +309,10 @@ bool scene_copy_inplace_no_main(const Scene *scene, Scene *new_scene)
 {
   const ID *id_for_copy = &scene->id;
 
+  if (G.debug & G_DEBUG_DEPSGRAPH_UUID) {
+    BKE_sequencer_check_uuids_unique_and_report(scene);
+  }
+
 #ifdef NESTED_ID_NASTY_WORKAROUND
   NestedIDHackTempStorage id_hack_storage;
   id_for_copy = nested_id_hack_get_discarded_pointers(&id_hack_storage, &scene->id);
diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c
index 20a75ebe3b9..b8e99899821 100644
--- a/source/creator/creator_args.c
+++ b/source/creator/creator_args.c
@@ -2189,6 +2189,12 @@ void main_args_setup(bContext *C, bArgs *ba)
               "--debug-depsgraph-pretty",
               CB_EX(arg_handle_debug_mode_generic_set, depsgraph_pretty),
               (void *)G_DEBUG_DEPSGRAPH_PRETTY);
+  BLI_argsAdd(ba,
+              1,
+              NULL,
+              "--debug-depsgraph-uuid",
+              CB_EX(arg_handle_debug_mode_generic_set, depsgraph_build),
+              (void *)G_DEBUG_DEPSGRAPH_UUID);
   BLI_argsAdd(ba,
               1,
               NULL,



More information about the Bf-blender-cvs mailing list