i965: Handle nested uniform array indexing
authorChris Forbes <chrisf@ijw.co.nz>
Tue, 18 Nov 2014 08:15:06 +0000 (21:15 +1300)
committerChris Forbes <chrisf@ijw.co.nz>
Mon, 24 Nov 2014 08:07:29 +0000 (21:07 +1300)
commitadefccd12a534f0deac7b78db73693fe1dcef2ec
tree675efd4c718f0deb40162911152a880b0cf6e663
parentc88385603ae8d983314b736a9459bbf7d002cf11
i965: Handle nested uniform array indexing

When converting a uniform array reference to a pull constant load, the
`reladdr` expression itself may have its own `reladdr`, arbitrarily
deeply. This arises from expressions like:

   a[b[x]]     where a, b are uniform arrays (or lowered const arrays),
               and x is not a constant.

Just iterate the lowering to pull constants until we stop seeing these
nested. For most shaders, there will be only one pass through this loop.

Fixes the piglit test:
tests/spec/glsl-1.20/linker/double-indirect-1.shader_test

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp