nvc0/ir: fix indirect access for images
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Sun, 22 May 2016 20:39:31 +0000 (22:39 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Sun, 22 May 2016 21:06:16 +0000 (23:06 +0200)
commita7fad12931a62bdd8483b68f7cccbf0ca01bcb89
treea7234a173dc8402273559d03d8415bb1dc899e3a
parentcb9a51d1f6db4c5a3baa2aed309875bf2e8746bd
nvc0/ir: fix indirect access for images

When the array doesn't start at 0 we need to account for su->tex.r.
While we are at it, make sure to avoid out of bounds access by masking
the index.

This fixes GL45-CTS.shading_language_420pack.binding_image_array.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reported-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp