mesa: call _mesa_remove_varying_reads() after compiling vertex shaders
authorBrian <brian.paul@tungstengraphics.com>
Mon, 7 Apr 2008 17:22:41 +0000 (11:22 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Mon, 7 Apr 2008 17:23:44 +0000 (11:23 -0600)
src/mesa/shader/slang/slang_compile.c

index bfb9ca4db6a0253a405555cbc183fd6dd440f064..0df673085b7aa14756c5efc886e23cfc058634a8 100644 (file)
@@ -31,6 +31,8 @@
 #include "main/imports.h"
 #include "main/context.h"
 #include "shader/program.h"
+#include "shader/programopt.h"
+#include "shader/prog_print.h"
 #include "shader/prog_parameter.h"
 #include "shader/grammar/grammar_mesa.h"
 #include "slang_codegen.h"
@@ -2186,6 +2188,19 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader)
    _slang_delete_mempool((slang_mempool *) ctx->Shader.MemPool);
    ctx->Shader.MemPool = NULL;
 
+   if (shader->Type == GL_VERTEX_SHADER) {
+      /* remove any reads of varying (output) registers */
+#if 0
+      printf("Pre-remove output reads:\n");
+      _mesa_print_program(shader->Programs[0]);
+#endif
+      _mesa_remove_varying_reads(shader->Programs[0]);
+#if 0
+      printf("Post-remove output reads:\n");
+      _mesa_print_program(shader->Programs[0]);
+#endif
+   }
+
    return success;
 }