[Bf-blender-cvs] [fe1a508e551] master: Depsgraph: Split debug flags

Sergey Sharybin noreply at git.blender.org
Wed Feb 21 10:45:17 CET 2018


Commit: fe1a508e551bc8309f552d69da0b74f7f5f5d46f
Author: Sergey Sharybin
Date:   Wed Feb 21 10:44:36 2018 +0100
Branches: master
https://developer.blender.org/rBfe1a508e551bc8309f552d69da0b74f7f5f5d46f

Depsgraph: Split debug flags

Now it's possible to have debug messages for following things:

- Graph construction
- Graph evaluation
- Graph tagging

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

M	source/blender/blenkernel/BKE_global.h
M	source/blender/blenkernel/intern/anim_sys.c
M	source/blender/blenkernel/intern/armature_update.c
M	source/blender/blenkernel/intern/curve.c
M	source/blender/blenkernel/intern/depsgraph.c
M	source/blender/blenkernel/intern/mask_evaluate.c
M	source/blender/blenkernel/intern/mesh.c
M	source/blender/blenkernel/intern/movieclip.c
M	source/blender/blenkernel/intern/object.c
M	source/blender/blenkernel/intern/object_update.c
M	source/blender/blenkernel/intern/particle_system.c
M	source/blender/blenkernel/intern/rigidbody.c
M	source/blender/blenkernel/intern/scene.c
M	source/blender/depsgraph/intern/depsgraph_intern.h
M	source/blender/python/intern/bpy_app.c
M	source/creator/creator_args.c

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

diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h
index 790c8051ace..f3d44164b1e 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -122,12 +122,15 @@ enum {
 	G_DEBUG_WM =        (1 << 5), /* operator, undo */
 	G_DEBUG_JOBS =      (1 << 6), /* jobs time profiling */
 	G_DEBUG_FREESTYLE = (1 << 7), /* freestyle messages */
-	G_DEBUG_DEPSGRAPH = (1 << 8), /* depsgraph messages */
-	G_DEBUG_SIMDATA =   (1 << 9), /* sim debug data display */
-	G_DEBUG_GPU_MEM =   (1 << 10), /* gpu memory in status bar */
+	G_DEBUG_DEPSGRAPH_BUILD      = (1 << 8),   /* depsgraph construction messages */
+	G_DEBUG_DEPSGRAPH_EVAL       = (1 << 9),   /* depsgraph evaluation messages */
+	G_DEBUG_DEPSGRAPH_TAG        = (1 << 10),  /* depsgraph tagging messages */
 	G_DEBUG_DEPSGRAPH_NO_THREADS = (1 << 11),  /* single threaded depsgraph */
-	G_DEBUG_GPU =        (1 << 12), /* gpu debug */
-	G_DEBUG_IO = (1 << 13),   /* IO Debugging (for Collada, ...)*/
+	G_DEBUG_DEPSGRAPH = (G_DEBUG_DEPSGRAPH_BUILD | G_DEBUG_DEPSGRAPH_EVAL | G_DEBUG_DEPSGRAPH_TAG),
+	G_DEBUG_SIMDATA =   (1 << 12), /* sim debug data display */
+	G_DEBUG_GPU_MEM =   (1 << 13), /* gpu memory in status bar */
+	G_DEBUG_GPU =       (1 << 14), /* gpu debug */
+	G_DEBUG_IO = (1 << 15),   /* IO Debugging (for Collada, ...)*/
 };
 
 #define G_DEBUG_ALL  (G_DEBUG | G_DEBUG_FFMPEG | G_DEBUG_PYTHON | G_DEBUG_EVENTS | G_DEBUG_WM | G_DEBUG_JOBS | \
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 9037122c4f8..95d9a769749 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -2918,7 +2918,7 @@ void BKE_animsys_evaluate_all_animation(Main *main, Scene *scene, float ctime)
 /* ************** */
 /* Evaluation API */
 
-#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH) printf
+#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) printf
 
 void BKE_animsys_eval_animdata(EvaluationContext *eval_ctx, ID *id)
 {
diff --git a/source/blender/blenkernel/intern/armature_update.c b/source/blender/blenkernel/intern/armature_update.c
index cc1bd9716b1..2e9b2f7d20f 100644
--- a/source/blender/blenkernel/intern/armature_update.c
+++ b/source/blender/blenkernel/intern/armature_update.c
@@ -54,9 +54,9 @@
 #include "DEG_depsgraph.h"
 
 #ifdef WITH_LEGACY_DEPSGRAPH
-#  define DEBUG_PRINT if (!DEG_depsgraph_use_legacy() && G.debug & G_DEBUG_DEPSGRAPH) printf
+#  define DEBUG_PRINT if (!DEG_depsgraph_use_legacy() && G.debug & G_DEBUG_DEPSGRAPH_EVAL) printf
 #else
-#  define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH) printf
+#  define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) printf
 #endif
 
 /* ********************** SPLINE IK SOLVER ******************* */
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index d18fda632aa..f0759748fee 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -5253,7 +5253,7 @@ void BKE_curve_rect_from_textbox(const struct Curve *cu, const struct TextBox *t
 void BKE_curve_eval_geometry(EvaluationContext *UNUSED(eval_ctx),
                              Curve *curve)
 {
-	if (G.debug & G_DEBUG_DEPSGRAPH) {
+	if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
 		printf("%s on %s\n", __func__, curve->id.name);
 	}
 	if (curve->bb == NULL || (curve->bb->flag & BOUNDBOX_DIRTY)) {
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 149158b9f5d..0fb9c4408d6 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -3002,7 +3002,7 @@ void DAG_id_tag_update_ex(Main *bmain, ID *id, short flag)
 
 	if (id == NULL) return;
 
-	if (G.debug & G_DEBUG_DEPSGRAPH) {
+	if (G.debug & G_DEBUG_DEPSGRAPH_TAG) {
 		printf("%s: id=%s flag=%d\n", __func__, id->name, flag);
 	}
 
diff --git a/source/blender/blenkernel/intern/mask_evaluate.c b/source/blender/blenkernel/intern/mask_evaluate.c
index 0d71cc548c7..9875b74548a 100644
--- a/source/blender/blenkernel/intern/mask_evaluate.c
+++ b/source/blender/blenkernel/intern/mask_evaluate.c
@@ -897,7 +897,7 @@ void BKE_mask_layer_evaluate_deform(MaskLayer *masklay, const float ctime)
 	}
 }
 
-#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH) printf
+#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) printf
 
 void BKE_mask_eval_animation(struct EvaluationContext *eval_ctx, Mask *mask)
 {
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 689ebc7e909..81a06ff17cc 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -2633,7 +2633,7 @@ Mesh *BKE_mesh_new_from_object(
 void BKE_mesh_eval_geometry(EvaluationContext *UNUSED(eval_ctx),
                             Mesh *mesh)
 {
-	if (G.debug & G_DEBUG_DEPSGRAPH) {
+	if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
 		printf("%s on %s\n", __func__, mesh->id.name);
 	}
 	if (mesh->bb == NULL || (mesh->bb->flag & BOUNDBOX_DIRTY)) {
diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c
index a416de07c6d..f67560fe006 100644
--- a/source/blender/blenkernel/intern/movieclip.c
+++ b/source/blender/blenkernel/intern/movieclip.c
@@ -77,7 +77,7 @@
 #  include "intern/openexr/openexr_multi.h"
 #endif
 
-#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH) printf
+#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) printf
 
 /*********************** movieclip buffer loaders *************************/
 
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index c6b4e3fb0c7..acc652fb1be 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -2646,7 +2646,7 @@ void BKE_object_handle_update_ex(EvaluationContext *eval_ctx,
 	 * which is only in BKE_object_where_is_calc now */
 	/* XXX: should this case be OB_RECALC_OB instead? */
 	if (ob->recalc & OB_RECALC_ALL) {
-		if (G.debug & G_DEBUG_DEPSGRAPH) {
+		if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
 			printf("recalcob %s\n", ob->id.name + 2);
 		}
 		/* Handle proxy copy for target. */
diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c
index 84d2f624577..85cf7d8560d 100644
--- a/source/blender/blenkernel/intern/object_update.c
+++ b/source/blender/blenkernel/intern/object_update.c
@@ -62,9 +62,9 @@
 #include "DEG_depsgraph.h"
 
 #ifdef WITH_LEGACY_DEPSGRAPH
-#  define DEBUG_PRINT if (!DEG_depsgraph_use_legacy() && G.debug & G_DEBUG_DEPSGRAPH) printf
+#  define DEBUG_PRINT if (!DEG_depsgraph_use_legacy() && G.debug & G_DEBUG_DEPSGRAPH_EVAL) printf
 #else
-#  define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH) printf
+#  define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) printf
 #endif
 
 static ThreadMutex material_lock = BLI_MUTEX_INITIALIZER;
@@ -153,7 +153,7 @@ void BKE_object_handle_data_update(EvaluationContext *eval_ctx,
 	Key *key;
 	float ctime = BKE_scene_frame_get(scene);
 
-	if (G.debug & G_DEBUG_DEPSGRAPH)
+	if (G.debug & G_DEBUG_DEPSGRAPH_EVAL)
 		printf("recalcdata %s\n", ob->id.name + 2);
 
 	/* TODO(sergey): Only used by legacy depsgraph. */
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index e4dcf6618fa..2a1e0f559d7 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -4405,7 +4405,7 @@ void BKE_particle_system_eval_init(EvaluationContext *UNUSED(eval_ctx),
                                    Scene *scene,
                                    Object *ob)
 {
-	if (G.debug & G_DEBUG_DEPSGRAPH) {
+	if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
 		printf("%s on %s\n", __func__, ob->id.name);
 	}
 	BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_DEPSGRAPH);
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index 39b0668f0b9..56e65b6f2c5 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -1690,7 +1690,7 @@ void BKE_rigidbody_rebuild_sim(EvaluationContext *UNUSED(eval_ctx),
 {
 	float ctime = BKE_scene_frame_get(scene);
 
-	if (G.debug & G_DEBUG_DEPSGRAPH) {
+	if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
 		printf("%s at %f\n", __func__, ctime);
 	}
 
@@ -1705,7 +1705,7 @@ void BKE_rigidbody_eval_simulation(EvaluationContext *UNUSED(eval_ctx),
 {
 	float ctime = BKE_scene_frame_get(scene);
 
-	if (G.debug & G_DEBUG_DEPSGRAPH) {
+	if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
 		printf("%s at %f\n", __func__, ctime);
 	}
 
@@ -1722,7 +1722,7 @@ void BKE_rigidbody_object_sync_transforms(EvaluationContext *UNUSED(eval_ctx),
 	RigidBodyWorld *rbw = scene->rigidbody_world;
 	float ctime = BKE_scene_frame_get(scene);
 
-	if (G.debug & G_DEBUG_DEPSGRAPH) {
+	if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
 		printf("%s on %s\n", __func__, ob->id.name);
 	}
 
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 2e5b14cd902..3f27e136e8c 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -1568,7 +1568,7 @@ static void scene_update_object_func(TaskPool * __restrict pool, void *taskdata,
 		double start_time = 0.0;
 		bool add_to_stats = false;
 
-		if (G.debug & G_DEBUG_DEPSGRAPH) {
+		if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
 			if (object->recalc & OB_RECALC_ALL) {
 				printf("Thread %d: update object %s\n", threadid, object->id.name);
 			}
@@ -1621,7 +1621,7 @@ static void print_threads_statistics(ThreadedObjectUpdateState *state)
 {
 	double finish_time;
 
-	if ((G.debug & G_DEBUG_DEPSGRAPH) == 0) {
+	if ((G.debug & G_DEBUG_DEPSGRAPH_EVAL) == 0) {
 		return;
 	}
 
@@ -1739,7 +1739,7 @@ static void scene_update_objects(EvaluationContext *eval_ctx, Main *bmain, Scene
 	}
 
 	/* Those are only needed when blender is run with --debug argument. */
-	if (G.debug & G_DEBUG_DEPSGRAPH) {
+	if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
 		const int tot_thread = BL

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list