aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/shader
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-07-22 12:11:36 -0700
committerEric Anholt <[email protected]>2010-07-22 12:11:36 -0700
commitc8d0a9f0065c321308be635529c95735f3beb68f (patch)
tree948adbc034c7b7ed08ada2377b5f62ec32046dd9 /src/mesa/shader
parent7095e2f860b91288c89c57add438e912e10df38e (diff)
ir_to_mesa: Add support for MESA_GLSL=dump environment var.
Diffstat (limited to 'src/mesa/shader')
-rw-r--r--src/mesa/shader/ir_to_mesa.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/mesa/shader/ir_to_mesa.cpp b/src/mesa/shader/ir_to_mesa.cpp
index bfb8e3201ac..c92fe49a207 100644
--- a/src/mesa/shader/ir_to_mesa.cpp
+++ b/src/mesa/shader/ir_to_mesa.cpp
@@ -2030,12 +2030,21 @@ get_mesa_program(GLcontext *ctx, struct gl_shader_program *shader_program,
int i;
struct gl_program *prog;
GLenum target;
+ const char *target_string;
GLboolean progress;
switch (shader->Type) {
- case GL_VERTEX_SHADER: target = GL_VERTEX_PROGRAM_ARB; break;
- case GL_FRAGMENT_SHADER: target = GL_FRAGMENT_PROGRAM_ARB; break;
- default: assert(!"should not be reached"); break;
+ case GL_VERTEX_SHADER:
+ target = GL_VERTEX_PROGRAM_ARB;
+ target_string = "vertex";
+ break;
+ case GL_FRAGMENT_SHADER:
+ target = GL_FRAGMENT_PROGRAM_ARB;
+ target_string = "fragment";
+ break;
+ default:
+ assert(!"should not be reached");
+ break;
}
validate_ir_tree(shader->ir);
@@ -2127,7 +2136,8 @@ get_mesa_program(GLcontext *ctx, struct gl_shader_program *shader_program,
}
set_branchtargets(&v, mesa_instructions, num_instructions);
- if (0) {
+ if (ctx->Shader.Flags & GLSL_DUMP) {
+ printf("Mesa %s program:\n", target_string);
print_program(mesa_instructions, mesa_instruction_annotation,
num_instructions);
}