diff options
author | Brian Paul <brianp@vmware.com> | 2009-02-06 10:21:36 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-02-06 10:21:36 -0700 |
commit | e01a03d2220199a4541f2cb8b42035237a571aa4 (patch) | |
tree | efc2fdd4c2341ad8763082396d44971481a28cf9 /src/mesa/shader/slang | |
parent | 6ce0c6e743b27cc284e8f164585cfe5892cd662a (diff) |
glsl: new MESA_GLSL env var for GLSL debugging features
Replaces the VERBOSE_GLSL, VERBOSE_GLSL_DUMP flags which only worked in debug
builds. MESA_GLSL will work both in debug and non-debug builds.
Also add facility to dump glUniform() calls to stdout.
Diffstat (limited to 'src/mesa/shader/slang')
-rw-r--r-- | src/mesa/shader/slang/slang_compile.c | 6 | ||||
-rw-r--r-- | src/mesa/shader/slang/slang_link.c | 19 | ||||
-rw-r--r-- | src/mesa/shader/slang/slang_log.c | 4 |
3 files changed, 14 insertions, 15 deletions
diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 40460e0c7e..cfed977905 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2796,9 +2796,9 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) shader->CompileStatus = success; -#if 0 - _mesa_write_shader_to_file(shader); -#endif + if (ctx->Shader.Flags & GLSL_LOG) { + _mesa_write_shader_to_file(shader); + } return success; } diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 77bcda0871..848a64f932 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -675,12 +675,12 @@ _slang_link(GLcontext *ctx, /* notify driver that a new fragment program has been compiled/linked */ ctx->Driver.ProgramStringNotify(ctx, GL_FRAGMENT_PROGRAM_ARB, &shProg->FragmentProgram->Base); - if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) { - printf("Mesa original fragment program:\n"); + if (ctx->Shader.Flags & GLSL_DUMP) { + _mesa_printf("Mesa pre-link fragment program:\n"); _mesa_print_program(&fragProg->Base); _mesa_print_program_parameters(ctx, &fragProg->Base); - printf("Mesa post-link fragment program:\n"); + _mesa_printf("Mesa post-link fragment program:\n"); _mesa_print_program(&shProg->FragmentProgram->Base); _mesa_print_program_parameters(ctx, &shProg->FragmentProgram->Base); } @@ -693,20 +693,23 @@ _slang_link(GLcontext *ctx, /* notify driver that a new vertex program has been compiled/linked */ ctx->Driver.ProgramStringNotify(ctx, GL_VERTEX_PROGRAM_ARB, &shProg->VertexProgram->Base); - if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) { - printf("Mesa original vertex program:\n"); + if (ctx->Shader.Flags & GLSL_DUMP) { + _mesa_printf("Mesa pre-link vertex program:\n"); _mesa_print_program(&vertProg->Base); _mesa_print_program_parameters(ctx, &vertProg->Base); - printf("Mesa post-link vertex program:\n"); + _mesa_printf("Mesa post-link vertex program:\n"); _mesa_print_program(&shProg->VertexProgram->Base); _mesa_print_program_parameters(ctx, &shProg->VertexProgram->Base); } } - if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) { - printf("Varying vars:\n"); + if (ctx->Shader.Flags & GLSL_DUMP) { + _mesa_printf("Varying vars:\n"); _mesa_print_parameter_list(shProg->Varying); + if (shProg->InfoLog) { + _mesa_printf("Info Log: %s\n", shProg->InfoLog); + } } shProg->LinkStatus = (shProg->VertexProgram || shProg->FragmentProgram); diff --git a/src/mesa/shader/slang/slang_log.c b/src/mesa/shader/slang/slang_log.c index d5576d7ee2..d7d2b4fbfd 100644 --- a/src/mesa/shader/slang/slang_log.c +++ b/src/mesa/shader/slang/slang_log.c @@ -77,10 +77,6 @@ slang_info_log_message(slang_info_log * log, const char *prefix, slang_string_concat(log->text, msg); slang_string_concat(log->text, "\n"); - if (MESA_VERBOSE & VERBOSE_GLSL) { - _mesa_printf("Mesa: GLSL %s", log->text); - } - return 1; } |