forked from bartvdbraak/blender
Depsgraph: Split debug flags
Now it's possible to have debug messages for following things: - Graph construction - Graph evaluation - Graph tagging
This commit is contained in:
parent
2e73efa9b8
commit
fe1a508e55
@ -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 | \
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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 ******************* */
|
||||
|
@ -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)) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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)) {
|
||||
|
@ -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 *************************/
|
||||
|
||||
|
@ -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. */
|
||||
|
@ -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. */
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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 = BLI_task_scheduler_num_threads(task_scheduler);
|
||||
state.statistics = MEM_callocN(tot_thread * sizeof(*state.statistics),
|
||||
"scene update objects stats");
|
||||
@ -1758,7 +1758,7 @@ static void scene_update_objects(EvaluationContext *eval_ctx, Main *bmain, Scene
|
||||
BLI_task_pool_work_and_wait(task_pool);
|
||||
BLI_task_pool_free(task_pool);
|
||||
|
||||
if (G.debug & G_DEBUG_DEPSGRAPH) {
|
||||
if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
|
||||
print_threads_statistics(&state);
|
||||
MEM_freeN(state.statistics);
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ void deg_editors_scene_update(struct Main *bmain, struct Scene *scene, bool upda
|
||||
|
||||
#define DEG_DEBUG_PRINTF(...) \
|
||||
do { \
|
||||
if (G.debug & G_DEBUG_DEPSGRAPH) { \
|
||||
if (G.debug & G_DEBUG_DEPSGRAPH_BUILD) { \
|
||||
fprintf(stderr, __VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
|
@ -357,6 +357,9 @@ static PyGetSetDef bpy_app_getsets[] = {
|
||||
{(char *)"debug_handlers", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_HANDLERS},
|
||||
{(char *)"debug_wm", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_WM},
|
||||
{(char *)"debug_depsgraph", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_DEPSGRAPH},
|
||||
{(char *)"debug_depsgraph_build", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_DEPSGRAPH_BUILD},
|
||||
{(char *)"debug_depsgraph_eval", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_DEPSGRAPH_EVAL},
|
||||
{(char *)"debug_depsgraph_tag", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_DEPSGRAPH_TAG},
|
||||
{(char *)"debug_simdata", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_SIMDATA},
|
||||
{(char *)"debug_gpumem", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_GPU_MEM},
|
||||
|
||||
|
@ -551,6 +551,9 @@ static int arg_handle_print_help(int UNUSED(argc), const char **UNUSED(argv), vo
|
||||
BLI_argsPrintArgDoc(ba, "--debug-jobs");
|
||||
BLI_argsPrintArgDoc(ba, "--debug-python");
|
||||
BLI_argsPrintArgDoc(ba, "--debug-depsgraph");
|
||||
BLI_argsPrintArgDoc(ba, "--debug-depsgraph-eval");
|
||||
BLI_argsPrintArgDoc(ba, "--debug-depsgraph-build");
|
||||
BLI_argsPrintArgDoc(ba, "--debug-depsgraph-tag");
|
||||
BLI_argsPrintArgDoc(ba, "--debug-depsgraph-no-threads");
|
||||
|
||||
BLI_argsPrintArgDoc(ba, "--debug-gpumem");
|
||||
@ -747,7 +750,13 @@ static const char arg_handle_debug_mode_generic_set_doc_jobs[] =
|
||||
static const char arg_handle_debug_mode_generic_set_doc_gpu[] =
|
||||
"\n\tEnable gpu debug context and information for OpenGL 4.3+.";
|
||||
static const char arg_handle_debug_mode_generic_set_doc_depsgraph[] =
|
||||
"\n\tEnable debug messages from dependency graph.";
|
||||
"\n\tEnable all debug messages from dependency graph.";
|
||||
static const char arg_handle_debug_mode_generic_set_doc_depsgraph_build[] =
|
||||
"\n\tEnable debug messages from dependency graph related on graph construction.";
|
||||
static const char arg_handle_debug_mode_generic_set_doc_depsgraph_tag[] =
|
||||
"\n\tEnable debug messages from dependency graph related on tagging.";
|
||||
static const char arg_handle_debug_mode_generic_set_doc_depsgraph_eval[] =
|
||||
"\n\tEnable debug messages from dependency graph related on evaluation.";
|
||||
static const char arg_handle_debug_mode_generic_set_doc_depsgraph_no_threads[] =
|
||||
"\n\tSwitch dependency graph to a single threaded evaluation.";
|
||||
static const char arg_handle_debug_mode_generic_set_doc_gpumem[] =
|
||||
@ -1857,6 +1866,12 @@ void main_args_setup(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle)
|
||||
CB_EX(arg_handle_debug_mode_generic_set, gpu), (void *)G_DEBUG_GPU);
|
||||
BLI_argsAdd(ba, 1, NULL, "--debug-depsgraph",
|
||||
CB_EX(arg_handle_debug_mode_generic_set, depsgraph), (void *)G_DEBUG_DEPSGRAPH);
|
||||
BLI_argsAdd(ba, 1, NULL, "--debug-depsgraph-build",
|
||||
CB_EX(arg_handle_debug_mode_generic_set, depsgraph_build), (void *)G_DEBUG_DEPSGRAPH_BUILD);
|
||||
BLI_argsAdd(ba, 1, NULL, "--debug-depsgraph-eval",
|
||||
CB_EX(arg_handle_debug_mode_generic_set, depsgraph_eval), (void *)G_DEBUG_DEPSGRAPH_EVAL);
|
||||
BLI_argsAdd(ba, 1, NULL, "--debug-depsgraph-tag",
|
||||
CB_EX(arg_handle_debug_mode_generic_set, depsgraph_tag), (void *)G_DEBUG_DEPSGRAPH_TAG);
|
||||
BLI_argsAdd(ba, 1, NULL, "--debug-depsgraph-no-threads",
|
||||
CB_EX(arg_handle_debug_mode_generic_set, depsgraph_no_threads), (void *)G_DEBUG_DEPSGRAPH_NO_THREADS);
|
||||
BLI_argsAdd(ba, 1, NULL, "--debug-gpumem",
|
||||
|
Loading…
Reference in New Issue
Block a user