ir_to_mesa: Add support for MESA_GLSL=log.
authorEric Anholt <eric@anholt.net>
Sun, 1 Aug 2010 18:40:41 +0000 (11:40 -0700)
committerEric Anholt <eric@anholt.net>
Sun, 1 Aug 2010 18:41:02 +0000 (11:41 -0700)
This is the option that dumps shader source to files in the current
directory.

src/mesa/program/ir_to_mesa.cpp

index 9274723eb7360dc0caa472a42fa021fe510909a4..8f790af09ac4560c4f540fa45462b1fcb568b3fa 100644 (file)
@@ -2514,6 +2514,10 @@ _mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader)
          sizeof(shader->builtins_to_link[0]) * state->num_builtins_to_link);
    shader->num_builtins_to_link = state->num_builtins_to_link;
 
+   if (ctx->Shader.Flags & GLSL_LOG) {
+      _mesa_write_shader_to_file(shader);
+   }
+
    /* Retain any live IR, but trash the rest. */
    reparent_ir(shader->ir, shader);