[Mesa-dev] [PATCH 1/3] glsl: don't eliminate unused outputs in SSO

Timothy Arceri t_arceri at yahoo.com.au
Thu Nov 19 02:48:18 PST 2015


From: Timothy Arceri <timothy.arceri at collabora.com>

Cc: Ian Romanick <ian.d.romanick at intel.com>
Cc: Gregory Hainaut <gregory.hainaut at gmail.com>
---
 src/glsl/linker.cpp | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 331d9a2..8e7d92e 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -4380,15 +4380,18 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
                 next == MESA_SHADER_FRAGMENT ? num_tfeedback_decls : 0,
                 tfeedback_decls);
 
-      demote_shader_inputs_and_outputs(sh_i, ir_var_shader_out);
-      demote_shader_inputs_and_outputs(sh_next, ir_var_shader_in);
+      if (!prog->SeparateShader) {
+         demote_shader_inputs_and_outputs(sh_i, ir_var_shader_out);
+         demote_shader_inputs_and_outputs(sh_next, ir_var_shader_in);
 
-      /* Eliminate code that is now dead due to unused outputs being demoted.
-       */
-      while (do_dead_code(sh_i->ir, false))
-         ;
-      while (do_dead_code(sh_next->ir, false))
-         ;
+         /* Eliminate code that is now dead due to unused outputs being
+          * demoted.
+          */
+         while (do_dead_code(sh_i->ir, false))
+            ;
+         while (do_dead_code(sh_next->ir, false))
+            ;
+      }
 
       /* This must be done after all dead varyings are eliminated. */
       if (!check_against_output_limit(ctx, prog, sh_i))
-- 
2.4.3



More information about the mesa-dev mailing list