Mesa (glsl2): ir_to_mesa: Add support for MESA_GLSL=log.

Eric Anholt anholt at kemper.freedesktop.org
Sun Aug 1 18:42:59 UTC 2010


Module: Mesa
Branch: glsl2
Commit: b42519108dc7ab104cf9ade65a508f54a0294406
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b42519108dc7ab104cf9ade65a508f54a0294406

Author: Eric Anholt <eric at anholt.net>
Date:   Sun Aug  1 11:40:41 2010 -0700

ir_to_mesa: Add support for MESA_GLSL=log.

This is the option that dumps shader source to files in the current
directory.

---

 src/mesa/program/ir_to_mesa.cpp |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 9274723..8f790af 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -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);
 




More information about the mesa-commit mailing list