glsl: Allow less restrictive uses of sampler array indexing in GLSL <= 1.20
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 5 Jan 2011 00:09:00 +0000 (16:09 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 6 Jan 2011 18:06:59 +0000 (10:06 -0800)
commite942f328365309a1d8240cfe8eb5d88391015f37
tree106383f28234c79ba990dd05d7cb9c3e3c0c549a
parentc60f1d8b007625f62a53010bb75e70462eb970ae
glsl: Allow less restrictive uses of sampler array indexing in GLSL <= 1.20

GLSL 1.10 and 1.20 allow any sort of sampler array indexing.
Restrictions were added in GLSL 1.30.  Commit f0f2ec4d added support
for the 1.30 restrictions, but it broke some valid 1.10/1.20 shaders.
This changes the error to a warning in GLSL 1.10, GLSL 1.20, and GLSL
ES 1.00.

There are some spurious whitespace changes in this commit.  I changed
the layout (and wording) of the error message so that all three cases
would be similar.  The 1.10/1.20 and 1.30 text is the same.  The only
difference is that one is an error, and the other is a warning.  The
GLSL ES 1.00 wording is similar but not quite the same.

Fixes piglit test
spec/glsl-1.10/compiler/constant-expressions/sampler-array-index-02.frag
and bugzilla #32374.
src/glsl/ast_to_hir.cpp