glsl: Lower variable indexing of system value arrays unconditionally.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 4 Apr 2016 07:31:45 +0000 (00:31 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 4 Apr 2016 21:29:21 +0000 (14:29 -0700)
commit5509d43a11d42f15c91572aaf69a0f8e1ec31c71
treebaa106a4bd02068f458346b824afe388b2fe367f
parent88ef2476dcdd61000cbae7ded9c8fa52927429d8
glsl: Lower variable indexing of system value arrays unconditionally.

lower_variable_index_to_cond_assign() did not handle system values.
gl_SampleMaskIn[] is a system value, and also an array.  Accessing it
with a variable index would trigger an unreachable() assert.

Rather than adding a new EmitNoIndirectSystemValues flag, we simply
lower unconditionally.  There is exactly one case where this occurs,
and for all current drivers, lowering produces optimal code.  Even
for future drivers with 32x MSAA, it produces reasonable code.

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

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/compiler/glsl/lower_variable_index_to_cond_assign.cpp