OSDN Git Service

glsl: Allow dynamic sampler array indexing with GLSL ES < 3.00
authorTapani Pälli <tapani.palli@intel.com>
Tue, 9 Jun 2015 10:28:44 +0000 (13:28 +0300)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 1 Jul 2015 14:22:40 +0000 (15:22 +0100)
commit5bec73364111907dc0a32c38b7d5f9b11c19626a
treed7d08d184e6bb9456569ca84fe8674ce62afd626
parent5985de6f1a9e7b01aef99d75d9564f7b2c40688b
glsl: Allow dynamic sampler array indexing with GLSL ES < 3.00

Dynamic indexing of sampler arrays is prohibited by GLSL ES 3.00.
Earlier versions allow 'constant-index-expression' indexing, where
index can contain a loop induction variable.

Patch allows dynamic indexing for sampler arrays when GLSL ES < 3.00.
This change makes 'sampler-array-index.frag' parser test in Piglit
pass + fishgl.com works when running Chrome on OpenGL ES 2.0 backend

v2: small change and some more commit message (Tapani)
v3: refactor checks to make it more readable (Ian Romanick)
v4: change warning comment in GLSL ES case (Curro)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: "10.5" and "10.6" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84225
(cherry picked from commit edb8383c98ee23385731d0fc23a6b6673528a8ec)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Conflicts:
src/glsl/ast_array_index.cpp
src/glsl/ast_array_index.cpp