diff options
author | Brian Paul <[email protected]> | 2008-11-01 10:57:25 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-11-01 16:05:40 -0600 |
commit | 131d42573ce1fc120c8ef75634979b6206e1eb0a (patch) | |
tree | 2d7d5f9665c9997874eeb04745b226a3750bff91 /src/mesa/shader | |
parent | 72c914805b8b3b37bf8f44d94bc25ca3d146ac66 (diff) |
mesa: additional debug flags for glsl debug/disassembly
Diffstat (limited to 'src/mesa/shader')
-rw-r--r-- | src/mesa/shader/slang/slang_link.c | 39 | ||||
-rw-r--r-- | src/mesa/shader/slang/slang_log.c | 9 |
2 files changed, 25 insertions, 23 deletions
diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index dd7d5be6d8b..1398a5ec6c7 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -219,6 +219,7 @@ link_uniform_vars(struct gl_shader_program *shProg, inst->Sampler, map[ inst->Sampler ]); */ /* here, texUnit is really samplerUnit */ + assert(inst->TexSrcUnit < MAX_SAMPLERS); inst->TexSrcUnit = samplerMap[inst->TexSrcUnit]; prog->SamplerTargets[inst->TexSrcUnit] = inst->TexSrcTarget; prog->SamplersUsed |= (1 << inst->TexSrcUnit); @@ -564,32 +565,30 @@ _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 0 - printf("************** original fragment program\n"); - _mesa_print_program(&fragProg->Base); - _mesa_print_program_parameters(ctx, &fragProg->Base); -#endif -#if 0 - printf("************** linked fragment prog\n"); - _mesa_print_program(&shProg->FragmentProgram->Base); - _mesa_print_program_parameters(ctx, &shProg->FragmentProgram->Base); -#endif + if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) { + printf("Mesa original fragment program:\n"); + _mesa_print_program(&fragProg->Base); + _mesa_print_program_parameters(ctx, &fragProg->Base); + + printf("Mesa post-link fragment program:\n"); + _mesa_print_program(&shProg->FragmentProgram->Base); + _mesa_print_program_parameters(ctx, &shProg->FragmentProgram->Base); + } } if (vertProg && shProg->VertexProgram) { /* notify driver that a new vertex program has been compiled/linked */ ctx->Driver.ProgramStringNotify(ctx, GL_VERTEX_PROGRAM_ARB, &shProg->VertexProgram->Base); -#if 0 - printf("************** original vertex program\n"); - _mesa_print_program(&vertProg->Base); - _mesa_print_program_parameters(ctx, &vertProg->Base); -#endif -#if 0 - printf("************** linked vertex prog\n"); - _mesa_print_program(&shProg->VertexProgram->Base); - _mesa_print_program_parameters(ctx, &shProg->VertexProgram->Base); -#endif + if (MESA_VERBOSE & VERBOSE_GLSL_DUMP) { + printf("Mesa original vertex program:\n"); + _mesa_print_program(&vertProg->Base); + _mesa_print_program_parameters(ctx, &vertProg->Base); + + printf("Mesa post-link vertex program:\n"); + _mesa_print_program(&shProg->VertexProgram->Base); + _mesa_print_program_parameters(ctx, &shProg->VertexProgram->Base); + } } 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 01591ceba5c..dc838c72ade 100644 --- a/src/mesa/shader/slang/slang_log.c +++ b/src/mesa/shader/slang/slang_log.c @@ -23,6 +23,7 @@ */ #include "main/imports.h" +#include "main/context.h" #include "slang_log.h" #include "slang_utility.h" @@ -86,9 +87,11 @@ slang_info_log_message(slang_info_log * log, const char *prefix, } slang_string_concat(log->text, msg); slang_string_concat(log->text, "\n"); -#if 0 /* debug */ - _mesa_printf("Mesa GLSL error/warning: %s\n", log->text); -#endif + + if (MESA_VERBOSE & VERBOSE_GLSL) { + _mesa_printf("Mesa: GLSL %s\n", log->text); + } + return 1; } |