From 5b88712ff932fcbcd0bb0fb257e8e9c2e247a82a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 31 Mar 2012 00:59:17 +0000 Subject: move debug flag into its own global var (G.debug), split up debug options. --debug --debug-ffmpeg --debug-python --debug-events --debug-wm This makes debug output easier to read - event debug prints would flood output too much before. For convenience: --debug-all turns all debug flags on (works as --debug did before). also removed some redundant whitespace in debug prints and prefix some prints with __func__ to give some context. --- source/blender/gpu/intern/gpu_codegen.c | 6 +++--- source/blender/gpu/intern/gpu_extensions.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/gpu') diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 76291aef584..14d6428bf50 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -587,7 +587,7 @@ static char *code_generate_fragment(ListBase *nodes, GPUOutput *output, const ch codegen_set_unique_ids(nodes); codegen_print_uniforms_functions(ds, nodes); - //if(G.f & G_DEBUG) + //if(G.debug & G_DEBUG) // BLI_dynstr_appendf(ds, "/* %s */\n", name); BLI_dynstr_append(ds, "void main(void)\n"); @@ -602,7 +602,7 @@ static char *code_generate_fragment(ListBase *nodes, GPUOutput *output, const ch code = BLI_dynstr_get_cstring(ds); BLI_dynstr_free(ds); - //if(G.f & G_DEBUG) printf("%s\n", code); + //if(G.debug & G_DEBUG) printf("%s\n", code); return code; } @@ -645,7 +645,7 @@ static char *code_generate_vertex(ListBase *nodes) BLI_dynstr_free(ds); - //if(G.f & G_DEBUG) printf("%s\n", code); + //if(G.debug & G_DEBUG) printf("%s\n", code); return code; } diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index 846ee2850be..40e6a8b2a35 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -220,7 +220,7 @@ int GPU_print_error(const char *str) { GLenum errCode; - if (G.f & G_DEBUG) { + if (G.debug & G_DEBUG) { if ((errCode = glGetError()) != GL_NO_ERROR) { fprintf(stderr, "%s opengl error: %s\n", str, gluErrorString(errCode)); return 1; @@ -942,7 +942,7 @@ static void shader_print_errors(const char *task, char *log, const char *code) fprintf(stderr, "GPUShader: %s error:\n", task); - if (G.f & G_DEBUG) { + if (G.debug & G_DEBUG) { c = code; while ((c < end) && (pos = strchr(c, '\n'))) { fprintf(stderr, "%2d ", line); -- cgit v1.2.3