Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-03-16 13:14:38 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-03-16 13:14:38 +0300
commit3baf31e73a7176fac8081b6648ce768b9504c2b1 (patch)
tree538b169e0dea4b949e5dd8b5a39b9db786955d3e /source/blender/depsgraph
parent5de9c8f6f0f5157251b8f9f103455ba7f3bf826a (diff)
Depsgraph: Move evaluation debug prints to depsgraph
This way we can easily control format and keep it consistent. And also possibly do other trickery, like coloring addresses!
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/DEG_depsgraph.h26
-rw-r--r--source/blender/depsgraph/intern/depsgraph.cc57
2 files changed, 83 insertions, 0 deletions
diff --git a/source/blender/depsgraph/DEG_depsgraph.h b/source/blender/depsgraph/DEG_depsgraph.h
index 0837f147275..72e90f49748 100644
--- a/source/blender/depsgraph/DEG_depsgraph.h
+++ b/source/blender/depsgraph/DEG_depsgraph.h
@@ -208,6 +208,32 @@ void DEG_editors_set_update_cb(DEG_EditorUpdateIDCb id_func,
void DEG_editors_update_pre(struct Main *bmain, struct Scene *scene, bool time);
+/* Evaluation Debug ------------------------------ */
+
+void DEG_debug_print_eval(const char* function_name,
+ const char* object_name,
+ const void* object_address);
+
+void DEG_debug_print_eval_subdata(const char *function_name,
+ const char *object_name,
+ const void *object_address,
+ const char *subdata_comment,
+ const char *subdata_name,
+ const void *subdata_address);
+
+void DEG_debug_print_eval_subdata_index(const char *function_name,
+ const char *object_name,
+ const void *object_address,
+ const char *subdata_comment,
+ const char *subdata_name,
+ const void *subdata_address,
+ const int subdata_index);
+
+void DEG_debug_print_eval_time(const char* function_name,
+ const char* object_name,
+ const void* object_address,
+ float time);
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc
index 2e87786639c..f8e12ef45c3 100644
--- a/source/blender/depsgraph/intern/depsgraph.cc
+++ b/source/blender/depsgraph/intern/depsgraph.cc
@@ -494,3 +494,60 @@ void DEG_editors_update_pre(Main *bmain, Scene *scene, bool time)
DEG::deg_editor_update_scene_pre_cb(bmain, scene, time);
}
}
+
+void DEG_debug_print_eval(const char *function_name,
+ const char *object_name,
+ const void *object_address)
+{
+ if ((G.debug & G_DEBUG_DEPSGRAPH_EVAL) == 0) {
+ return;
+ }
+ printf("%s on %s (%p)\n", function_name, object_name, object_address);
+}
+
+void DEG_debug_print_eval_subdata(const char *function_name,
+ const char *object_name,
+ const void *object_address,
+ const char *subdata_comment,
+ const char *subdata_name,
+ const void *subdata_address)
+{
+ if ((G.debug & G_DEBUG_DEPSGRAPH_EVAL) == 0) {
+ return;
+ }
+ printf("%s on %s (%p) %s %s (%p)\n",
+ function_name,
+ object_name, object_address,
+ subdata_comment,
+ subdata_name, subdata_address);
+}
+
+void DEG_debug_print_eval_subdata_index(const char *function_name,
+ const char *object_name,
+ const void *object_address,
+ const char *subdata_comment,
+ const char *subdata_name,
+ const void *subdata_address,
+ const int subdata_index)
+{
+ if ((G.debug & G_DEBUG_DEPSGRAPH_EVAL) == 0) {
+ return;
+ }
+ printf("%s on %s (%p) %s %s[%d] (%p)\n",
+ function_name,
+ object_name, object_address,
+ subdata_comment,
+ subdata_name, subdata_index, subdata_address);
+}
+
+void DEG_debug_print_eval_time(const char *function_name,
+ const char *object_name,
+ const void *object_address,
+ float time)
+{
+ if ((G.debug & G_DEBUG_DEPSGRAPH_EVAL) == 0) {
+ return;
+ }
+ printf("%s on %s (%p) at time %f\n",
+ function_name, object_name, object_address, time);
+}