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: [email protected]
Signed-off-by: Kenneth Graunke <[email protected]>
---
 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

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to