nir: Fix interaction of GL_CLAMP lowering with texture offsets.
authorEric Anholt <eric@anholt.net>
Tue, 21 Nov 2017 21:42:08 +0000 (13:42 -0800)
committerEric Anholt <eric@anholt.net>
Thu, 14 Dec 2017 22:36:17 +0000 (14:36 -0800)
commitb08b6289943b225b6451e6c8ce331a8c11bd0c7f
tree50590887b30bb02c9f8aebc099a2ff8f79560043
parent52f024b0523763799e71de0a327d5143df72a792
nir: Fix interaction of GL_CLAMP lowering with texture offsets.

We want the clamping of the coordinate to apply after the offset, so we
need to do math to lower the offset out of the instruction.  Fixes texwrap
offset cases for GL_CLAMP with GL_NEAREST on vc5.

Note: I moved the get_texture_size() verbatim, so that it was defined
before use.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/compiler/nir/nir_lower_tex.c