nir/lower_tex: Add support for lowering coordinate offsets

On i965, we can't support coordinate offsets for texelFetch or rectangle
textures.  Previously, we were doing this with a GLSL pass but we need to
do it in NIR if we want those workarounds for SPIR-V.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-dev@lists.freedesktop.org>
This commit is contained in:
Jason Ekstrand
2016-07-20 20:32:31 -07:00
parent 843fc8f3e7
commit d9156efc52
2 changed files with 64 additions and 0 deletions

View File

@@ -2408,6 +2408,16 @@ typedef struct nir_lower_tex_options {
*/
unsigned lower_txp;
/**
* If true, lower away nir_tex_src_offset for all texelfetch instructions.
*/
bool lower_txf_offset;
/**
* If true, lower away nir_tex_src_offset for all rect textures.
*/
bool lower_rect_offset;
/**
* If true, lower rect textures to 2D, using txs to fetch the
* texture dimensions and dividing the texture coords by the