summaryrefslogtreecommitdiffstats
path: root/src/mesa/program
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-08-17 12:37:49 -0700
committerEric Anholt <[email protected]>2010-08-17 12:39:03 -0700
commit1b708d8f4dd1a853de8537e81e6d5bf8c9f2aed1 (patch)
treef75af72aa90f201abed71094c7799f6c13543c69 /src/mesa/program
parent6cee1d6adfba45508e181ad61377dfc95cf82674 (diff)
mesa: Dump shader source before validating the shader.
This will make extracting source to produce minimal testcases for shader compile issues easier.
Diffstat (limited to 'src/mesa/program')
-rw-r--r--src/mesa/program/ir_to_mesa.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 1fb578516ce..7fff66c78b1 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2627,6 +2627,11 @@ _mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader)
state->error = preprocess(state, &source, &state->info_log,
&ctx->Extensions);
+ if (ctx->Shader.Flags & GLSL_DUMP) {
+ printf("GLSL source for shader %d:\n", shader->Name);
+ printf("%s\n", shader->Source);
+ }
+
if (!state->error) {
_mesa_glsl_lexer_ctor(state, source);
_mesa_glsl_parse(state);
@@ -2662,15 +2667,10 @@ _mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader)
_mesa_write_shader_to_file(shader);
}
- if (ctx->Shader.Flags & GLSL_DUMP) {
- printf("GLSL source for shader %d:\n", shader->Name);
- printf("%s\n", shader->Source);
-
- if (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) && shader->CompileStatus) {
+ printf("GLSL IR for shader %d:\n", shader->Name);
+ _mesa_print_ir(shader->ir, NULL);
+ printf("\n\n");
}
/* Retain any live IR, but trash the rest. */