[Bf-blender-cvs] [65e6654c85a] blender2.8: Depsgraph: Allow per-depsgraph debug flags

Sergey Sharybin noreply at git.blender.org
Wed May 2 17:10:50 CEST 2018


Commit: 65e6654c85a5b2fd44444057e87bd36d6ee0597a
Author: Sergey Sharybin
Date:   Wed May 2 11:46:56 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB65e6654c85a5b2fd44444057e87bd36d6ee0597a

Depsgraph: Allow per-depsgraph debug flags

Currently only affects EVALUATION debug messages, rest are to be
supported on per-depsgraph level.

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

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/group.c
M	source/blender/blenkernel/intern/layer.c
M	source/blender/blenkernel/intern/mask_evaluate.c
M	source/blender/blenkernel/intern/material.c
M	source/blender/blenkernel/intern/mesh.c
M	source/blender/blenkernel/intern/movieclip.c
M	source/blender/blenkernel/intern/node.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/depsgraph/DEG_depsgraph.h
M	source/blender/depsgraph/DEG_depsgraph_debug.h
M	source/blender/depsgraph/intern/depsgraph.cc
M	source/blender/depsgraph/intern/depsgraph.h
M	source/blender/depsgraph/intern/depsgraph_debug.cc
M	source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc

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

diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 2f2193db51b..4eeabd7a4da 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -2949,7 +2949,7 @@ void BKE_animsys_eval_animdata(Depsgraph *depsgraph, ID *id)
 	Scene *scene = NULL; /* XXX: this is only needed for flushing RNA updates,
 	                      * which should get handled as part of the dependency graph instead...
 	                      */
-	DEG_debug_print_eval_time(__func__, id->name, id, ctime);
+	DEG_debug_print_eval_time(depsgraph, __func__, id->name, id, ctime);
 	short recalc = ADT_RECALC_ANIM;
 	const Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
 	/* If animation component is directly tagged for update, we always apply f-curves. */
@@ -2991,7 +2991,7 @@ void BKE_animsys_eval_driver(Depsgraph *depsgraph,
 	fcu = find_driver_from_evaluated_id(id, fcu);
 
 	DEG_debug_print_eval_subdata_index(
-	        __func__, id->name, id, "fcu", fcu->rna_path, fcu, fcu->array_index);
+	        depsgraph, __func__, id->name, id, "fcu", fcu->rna_path, fcu, fcu->array_index);
 
 	RNA_id_pointer_create(id, &id_ptr);
 
diff --git a/source/blender/blenkernel/intern/armature_update.c b/source/blender/blenkernel/intern/armature_update.c
index e626ed42062..bf21019a948 100644
--- a/source/blender/blenkernel/intern/armature_update.c
+++ b/source/blender/blenkernel/intern/armature_update.c
@@ -567,14 +567,14 @@ BLI_INLINE bPoseChannel *pose_pchan_get_indexed(Object *ob, int pchan_index)
 	return pose->chan_array[pchan_index];
 }
 
-void BKE_pose_eval_init(struct Depsgraph *UNUSED(depsgraph),
+void BKE_pose_eval_init(struct Depsgraph *depsgraph,
                         Scene *UNUSED(scene),
                         Object *ob)
 {
 	bPose *pose = ob->pose;
 	BLI_assert(pose != NULL);
 
-	DEG_debug_print_eval(__func__, ob->id.name, ob);
+	DEG_debug_print_eval(depsgraph, __func__, ob->id.name, ob);
 
 	BLI_assert(ob->type == OB_ARMATURE);
 
@@ -601,7 +601,7 @@ void BKE_pose_eval_init_ik(struct Depsgraph *depsgraph,
                            Scene *scene,
                            Object *ob)
 {
-	DEG_debug_print_eval(__func__, ob->id.name, ob);
+	DEG_debug_print_eval(depsgraph, __func__, ob->id.name, ob);
 	BLI_assert(ob->type == OB_ARMATURE);
 	const float ctime = BKE_scene_frame_get(scene); /* not accurate... */
 	bArmature *arm = (bArmature *)ob->data;
@@ -624,7 +624,7 @@ void BKE_pose_eval_bone(struct Depsgraph *depsgraph,
 {
 	bPoseChannel *pchan = pose_pchan_get_indexed(ob, pchan_index);
 	DEG_debug_print_eval_subdata(
-	        __func__, ob->id.name, ob, "pchan", pchan->name, pchan);
+	        depsgraph, __func__, ob->id.name, ob, "pchan", pchan->name, pchan);
 	BLI_assert(ob->type == OB_ARMATURE);
 	bArmature *arm = (bArmature *)ob->data;
 	if (arm->edbo || (arm->flag & ARM_RESTPOS)) {
@@ -661,7 +661,7 @@ void BKE_pose_constraints_evaluate(struct Depsgraph *depsgraph,
 {
 	bPoseChannel *pchan = pose_pchan_get_indexed(ob, pchan_index);
 	DEG_debug_print_eval_subdata(
-	        __func__, ob->id.name, ob, "pchan", pchan->name, pchan);
+	        depsgraph, __func__, ob->id.name, ob, "pchan", pchan->name, pchan);
 	bArmature *arm = (bArmature *)ob->data;
 	if (arm->flag & ARM_RESTPOS) {
 		return;
@@ -677,13 +677,13 @@ void BKE_pose_constraints_evaluate(struct Depsgraph *depsgraph,
 	}
 }
 
-void BKE_pose_bone_done(struct Depsgraph *UNUSED(depsgraph),
+void BKE_pose_bone_done(struct Depsgraph *depsgraph,
                         struct Object *ob,
                         int pchan_index)
 {
 	bPoseChannel *pchan = pose_pchan_get_indexed(ob, pchan_index);
 	float imat[4][4];
-	DEG_debug_print_eval(__func__, pchan->name, pchan);
+	DEG_debug_print_eval(depsgraph, __func__, pchan->name, pchan);
 	if (pchan->bone) {
 		invert_m4_m4(imat, pchan->bone->arm_mat);
 		mul_m4_m4m4(pchan->chan_mat, pchan->pose_mat, imat);
@@ -697,7 +697,7 @@ void BKE_pose_iktree_evaluate(struct Depsgraph *depsgraph,
 {
 	bPoseChannel *rootchan = pose_pchan_get_indexed(ob, rootchan_index);
 	DEG_debug_print_eval_subdata(
-	        __func__, ob->id.name, ob, "rootchan", rootchan->name, rootchan);
+	        depsgraph, __func__, ob->id.name, ob, "rootchan", rootchan->name, rootchan);
 	BLI_assert(ob->type == OB_ARMATURE);
 	const float ctime = BKE_scene_frame_get(scene); /* not accurate... */
 	bArmature *arm = (bArmature *)ob->data;
@@ -715,7 +715,7 @@ void BKE_pose_splineik_evaluate(struct Depsgraph *depsgraph,
 {
 	bPoseChannel *rootchan = pose_pchan_get_indexed(ob, rootchan_index);
 	DEG_debug_print_eval_subdata(
-	        __func__, ob->id.name, ob, "rootchan", rootchan->name, rootchan);
+	        depsgraph, __func__, ob->id.name, ob, "rootchan", rootchan->name, rootchan);
 	BLI_assert(ob->type == OB_ARMATURE);
 	const float ctime = BKE_scene_frame_get(scene); /* not accurate... */
 	bArmature *arm = (bArmature *)ob->data;
@@ -725,7 +725,7 @@ void BKE_pose_splineik_evaluate(struct Depsgraph *depsgraph,
 	BKE_splineik_execute_tree(depsgraph, scene, ob, rootchan, ctime);
 }
 
-void BKE_pose_eval_flush(struct Depsgraph *UNUSED(depsgraph),
+void BKE_pose_eval_flush(struct Depsgraph *depsgraph,
                          Scene *scene,
                          Object *ob)
 {
@@ -733,7 +733,7 @@ void BKE_pose_eval_flush(struct Depsgraph *UNUSED(depsgraph),
 	BLI_assert(pose != NULL);
 
 	float ctime = BKE_scene_frame_get(scene); /* not accurate... */
-	DEG_debug_print_eval(__func__, ob->id.name, ob);
+	DEG_debug_print_eval(depsgraph, __func__, ob->id.name, ob);
 	BLI_assert(ob->type == OB_ARMATURE);
 
 	/* release the IK tree */
@@ -744,10 +744,10 @@ void BKE_pose_eval_flush(struct Depsgraph *UNUSED(depsgraph),
 	pose->chan_array = NULL;
 }
 
-void BKE_pose_eval_proxy_copy(struct Depsgraph *UNUSED(depsgraph), Object *ob)
+void BKE_pose_eval_proxy_copy(struct Depsgraph *depsgraph, Object *ob)
 {
 	BLI_assert(ID_IS_LINKED(ob) && ob->proxy_from != NULL);
-	DEG_debug_print_eval(__func__, ob->id.name, ob);
+	DEG_debug_print_eval(depsgraph, __func__, ob->id.name, ob);
 	if (BKE_pose_copy_result(ob->pose, ob->proxy_from->pose) == false) {
 		printf("Proxy copy error, lib Object: %s proxy Object: %s\n",
 		       ob->id.name + 2, ob->proxy_from->id.name + 2);
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 661ffdbcd27..cea5685a7a1 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -5255,10 +5255,10 @@ void BKE_curve_rect_from_textbox(const struct Curve *cu, const struct TextBox *t
 
 /* **** Depsgraph evaluation **** */
 
-void BKE_curve_eval_geometry(Depsgraph *UNUSED(depsgraph),
+void BKE_curve_eval_geometry(Depsgraph *depsgraph,
                              Curve *curve)
 {
-	DEG_debug_print_eval(__func__, curve->id.name, curve);
+	DEG_debug_print_eval(depsgraph, __func__, curve->id.name, curve);
 	if (curve->bb == NULL || (curve->bb->flag & BOUNDBOX_DIRTY)) {
 		BKE_curve_texspace_calc(curve);
 	}
diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c
index ae031d21b88..f2c9bfdd974 100644
--- a/source/blender/blenkernel/intern/group.c
+++ b/source/blender/blenkernel/intern/group.c
@@ -384,6 +384,6 @@ void BKE_group_handle_recalc_and_update(struct Depsgraph *depsgraph, Scene *scen
 void BKE_group_eval_view_layers(struct Depsgraph *depsgraph,
                                 Group *group)
 {
-	DEG_debug_print_eval(__func__, group->id.name, group);
+	DEG_debug_print_eval(depsgraph, __func__, group->id.name, group);
 	BKE_layer_eval_view_layer(depsgraph, &group->id, group->view_layer);
 }
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c
index 215826454a9..9ab318bc58d 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -54,6 +54,7 @@
 #include "DNA_workspace_types.h"
 
 #include "DEG_depsgraph.h"
+#include "DEG_depsgraph_debug.h"
 #include "DEG_depsgraph_query.h"
 
 #include "DRW_engine.h"
@@ -2369,9 +2370,9 @@ static void idproperty_reset(IDProperty **props, IDProperty *props_ref)
 	}
 }
 
-static void layer_eval_layer_collection_pre(ID *owner_id, ViewLayer *view_layer)
+static void layer_eval_layer_collection_pre(Depsgraph *depsgraph, ID *owner_id, ViewLayer *view_layer)
 {
-	DEG_debug_print_eval(__func__, view_layer->name, view_layer);
+	DEG_debug_print_eval(depsgraph, __func__, view_layer->name, view_layer);
 	Scene *scene = (GS(owner_id->name) == ID_SCE) ? (Scene *)owner_id : NULL;
 
 	for (Base *base = view_layer->object_bases.first; base != NULL; base = base->next) {
@@ -2415,7 +2416,7 @@ static void layer_eval_layer_collection(Depsgraph *depsgraph,
                                         LayerCollection *layer_collection,
                                         LayerCollection *parent_layer_collection)
 {
-	if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
+	if (DEG_get_debug_flags(depsgraph) & G_DEBUG_DEPSGRAPH_EVAL) {
 		/* TODO)sergey): Try to make it more generic and handled by depsgraph messaging. */
 		printf("%s on %s (%p) [%s], parent %s (%p) [%s]\n",
 		       __func__,
@@ -2471,9 +2472,9 @@ static void layer_eval_layer_collection(Depsgraph *depsgraph,
 	}
 }
 
-static void layer_eval_layer_collection_post(ViewLayer *view_layer)
+static void layer_eval_layer_collection_post(Depsgraph *depsgraph, ViewLayer *view_layer)
 {
-	DEG_debug_print_eval(__func__, view_layer->name, view_layer);
+	DEG_debug_print_eval(depsgraph, __func__, view_layer->name, view_layer);
 	/* Create array of bases, for fast index-based lookup. */
 	const int num_object_bases = BLI_listbase_count(&view_layer->object_bases);
 	MEM_SAFE_FREE(view_layer->object_bases_array);
@@ -2511,11 +2512,11 @@ void BKE_layer_eval_view_layer(struct Depsgraph *depsgraph,
                                struct ID *owner_id,
                                ViewLayer *view_layer)
 {
-	layer_eval_layer_collection_pre(owner_id, view_layer);
+	layer_eval_layer_collection_pre(depsgraph, owner_id, view_layer);
 	layer_eval_collections_recurse(depsgraph,
 	                               &view_layer->layer_collections,

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list