[Mesa-stable] [PATCH] glsl: Lower variable indexing of system value arrays; treat like inputs.

Kenneth Graunke kenneth at whitecape.org
Mon Apr 4 09:08:51 UTC 2016


Some system values, such as gl_SampleMaskIn[], may be arrays.
lower_variable_index_to_cond_assign() did not handle this case and would
hit an unreachable() assert.

For now, lower when EmitNoIndirectInput is set.  We could potentially
add another flag for system values, but I'm not sure how useful that
would be.

Fixes Piglit's new samplemaskin-indirect test.  Also fixes many ES31-CTS
tests when OES_sample_variables is enabled.

Cc: mesa-stable at lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/compiler/glsl/lower_variable_index_to_cond_assign.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/compiler/glsl/lower_variable_index_to_cond_assign.cpp b/src/compiler/glsl/lower_variable_index_to_cond_assign.cpp
index 278d545..2391089 100644
--- a/src/compiler/glsl/lower_variable_index_to_cond_assign.cpp
+++ b/src/compiler/glsl/lower_variable_index_to_cond_assign.cpp
@@ -385,6 +385,7 @@ public:
       case ir_var_const_in:
          return this->lower_temps;
 
+      case ir_var_system_value:
       case ir_var_shader_in:
          /* The input array size is unknown at compiler time for non-patch
           * inputs in TCS and TES. The arrays are sized to
-- 
2.7.4



More information about the mesa-stable mailing list