glsl: In ir_set_program_inouts, handle indexing outside array/matrix bounds.
authorPaul Berry <stereotype441@gmail.com>
Wed, 31 Jul 2013 18:25:13 +0000 (11:25 -0700)
committerPaul Berry <stereotype441@gmail.com>
Fri, 2 Aug 2013 03:19:39 +0000 (20:19 -0700)
commitcea946e39d62b95139b2d16520bf7b9b509d5fbc
treec2a66ce2ed1f77f2e9044b0d61c5acbf411a63ea
parent1c789d8087327203d3dcf5c140bf9d9c65b86086
glsl: In ir_set_program_inouts, handle indexing outside array/matrix bounds.

According to GLSL, indexing into an array or matrix with an
out-of-range constant results in a compile error.  However, indexing
with an out-of-range value that isn't constant merely results in
undefined results.

Since optimization passes (e.g. loop unrolling) can convert
non-constant array indices into constant array indices, it's possible
that ir_set_program_inouts will encounter a constant array index that
is out of range; if this happens, just mark the whole array as used.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/ir_set_program_inouts.cpp