summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_lower_tex.c
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2015-11-02 17:58:29 -0800
committerJason Ekstrand <jason.ekstrand@intel.com>2016-02-09 15:00:17 -0800
commit5ec456375e4fdd0b6c7d797f99191044e19ead74 (patch)
treec34b2d2e4560f516ef3ab10bd798a6a3b7c469c1 /src/compiler/nir/nir_lower_tex.c
parentee85014b90af1d94d637ec763a803479e9bac5dc (diff)
downloadexternal_mesa3d-5ec456375e4fdd0b6c7d797f99191044e19ead74.zip
external_mesa3d-5ec456375e4fdd0b6c7d797f99191044e19ead74.tar.gz
external_mesa3d-5ec456375e4fdd0b6c7d797f99191044e19ead74.tar.bz2
nir: Separate texture from sampler in nir_tex_instr
This commit adds the capability to NIR to support separate textures and samplers. As it currently stands, glsl_to_nir only sets the texture deref and leaves the sampler deref alone as it did before and nir_lower_samplers assumes this. Backends can still assume that they are combined and only look at only at the texture index. Or, if they wish, they can assume that they are separate because nir_lower_samplers, tgsi_to_nir, and prog_to_nir all set both texture and sampler index whenever a sampler is required (the two indices are the same in this case). Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/compiler/nir/nir_lower_tex.c')
-rw-r--r--src/compiler/nir/nir_lower_tex.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c
index 4c0759b..806acd8 100644
--- a/src/compiler/nir/nir_lower_tex.c
+++ b/src/compiler/nir/nir_lower_tex.c
@@ -291,11 +291,11 @@ nir_lower_tex_block(nir_block *block, void *void_state)
/* mask of src coords to saturate (clamp): */
unsigned sat_mask = 0;
- if ((1 << tex->texture_index) & state->options->saturate_r)
+ if ((1 << tex->sampler_index) & state->options->saturate_r)
sat_mask |= (1 << 2); /* .z */
- if ((1 << tex->texture_index) & state->options->saturate_t)
+ if ((1 << tex->sampler_index) & state->options->saturate_t)
sat_mask |= (1 << 1); /* .y */
- if ((1 << tex->texture_index) & state->options->saturate_s)
+ if ((1 << tex->sampler_index) & state->options->saturate_s)
sat_mask |= (1 << 0); /* .x */
/* If we are clamping any coords, we must lower projector first