summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shaderapi.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2014-03-01 00:11:18 -0800
committerKenneth Graunke <[email protected]>2014-03-02 13:37:09 -0800
commitc95ec27a4afbc43a226c3be2892598500ab906f7 (patch)
tree0d50c64f57f1847677fff4664c8175ff7994c8f7 /src/mesa/main/shaderapi.c
parent3f37dd913f3461fb197e878739a269e639852667 (diff)
mesa: Move MESA_GLSL=dump output to stderr.
i965 recently moved debug printfs to use stderr, including ones which trigger on MESA_GLSL=dump. This resulted in scrambled output. For drivers using ir_to_mesa, print_program was already using stderr, yet all the code around it was using stdout. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderapi.c')
-rw-r--r--src/mesa/main/shaderapi.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index cbf83900d72..e2f3462af2b 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -838,9 +838,10 @@ compile_shader(struct gl_context *ctx, GLuint shaderObj)
sh->CompileStatus = GL_FALSE;
} else {
if (ctx->Shader.Flags & GLSL_DUMP) {
- printf("GLSL source for %s shader %d:\n",
- _mesa_shader_stage_to_string(sh->Stage), sh->Name);
- printf("%s\n", sh->Source);
+ fprintf(stderr, "GLSL source for %s shader %d:\n",
+ _mesa_shader_stage_to_string(sh->Stage), sh->Name);
+ fprintf(stderr, "%s\n", sh->Source);
+ fflush(stderr);
}
/* this call will set the shader->CompileStatus field to indicate if
@@ -854,16 +855,17 @@ compile_shader(struct gl_context *ctx, GLuint shaderObj)
if (ctx->Shader.Flags & GLSL_DUMP) {
if (sh->CompileStatus) {
- printf("GLSL IR for shader %d:\n", sh->Name);
- _mesa_print_ir(stdout, sh->ir, NULL);
- printf("\n\n");
+ fprintf(stderr, "GLSL IR for shader %d:\n", sh->Name);
+ _mesa_print_ir(stderr, sh->ir, NULL);
+ fprintf(stderr, "\n\n");
} else {
- printf("GLSL shader %d failed to compile.\n", sh->Name);
+ fprintf(stderr, "GLSL shader %d failed to compile.\n", sh->Name);
}
if (sh->InfoLog && sh->InfoLog[0] != 0) {
- printf("GLSL shader %d info log:\n", sh->Name);
- printf("%s\n", sh->InfoLog);
+ fprintf(stderr, "GLSL shader %d info log:\n", sh->Name);
+ fprintf(stderr, "%s\n", sh->InfoLog);
}
+ fflush(stderr);
}
}