diff options
author | Eric Anholt <eric@anholt.net> | 2010-08-18 11:35:15 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-08-18 14:16:06 -0700 |
commit | 0df61bdb669d03d9c25e49d5698f193deca3cf6d (patch) | |
tree | ff9496e723c40dd4f11fe789dce00721fc87aecd | |
parent | 665d75cc5a23f8024034d0c4176fb281f94a30e9 (diff) |
mesa: Make MESA_GLSL=dump include when compile/link fails, and the info log.
-rw-r--r-- | src/mesa/program/ir_to_mesa.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index 7de1939b63..58d3b41d08 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -2691,10 +2691,18 @@ _mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader) _mesa_write_shader_to_file(shader); } - if ((ctx->Shader.Flags & GLSL_DUMP) && shader->CompileStatus) { - printf("GLSL IR for shader %d:\n", shader->Name); - _mesa_print_ir(shader->ir, NULL); - printf("\n\n"); + if (ctx->Shader.Flags & GLSL_DUMP) { + if (shader->CompileStatus) { + printf("GLSL IR for shader %d:\n", shader->Name); + _mesa_print_ir(shader->ir, NULL); + printf("\n\n"); + } else { + printf("GLSL shader %d failed to compile.\n", shader->Name); + } + if (shader->InfoLog && shader->InfoLog[0] != 0) { + printf("GLSL shader %d info log:\n", shader->Name); + printf("%s\n", shader->InfoLog); + } } /* Retain any live IR, but trash the rest. */ @@ -2741,8 +2749,15 @@ _mesa_glsl_link_shader(GLcontext *ctx, struct gl_shader_program *prog) } if (prog->LinkStatus) { - if (!ctx->Driver.LinkShader(ctx, prog)) + if (!ctx->Driver.LinkShader(ctx, prog)) { prog->LinkStatus = GL_FALSE; + printf("GLSL shader program %d failed to link\n", prog->Name); + } + + if (prog->InfoLog && prog->InfoLog[0] != 0) { + printf("GLSL shader program %d info log:\n", prog->Name); + printf("%s\n", prog->InfoLog); + } } } |