summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Smith <asmith@feralinteractive.com>2017-11-07 10:52:48 +0000
committerAndres Gomez <agomez@igalia.com>2017-11-21 18:16:45 +0200
commit2c9d72046f43d7f81722bee113eb097d2d7121c9 (patch)
tree3150d588256b1ad70ef3945564dd1ea967e85a2e
parent9d49fd747c7925326380cc25daf44ee49a10f18a (diff)
downloadmesa-2c9d72046f43d7f81722bee113eb097d2d7121c9.tar.gz
nir/spirv: tg4 requires a sampler
Gather operations in both GLSL and SPIR-V require a sampler. Fixes gathers returning garbage when using separate texture/samplers (on AMD, was using an invalid sampler descriptor). Signed-off-by: Alex Smith <asmith@feralinteractive.com> Cc: "17.2 17.3" <mesa-stable@lists.freedesktop.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit 4122d008466cef47eaa3f958924618060f4e4330)
-rw-r--r--src/compiler/nir/nir.h1
-rw-r--r--src/compiler/spirv/spirv_to_nir.c2
2 files changed, 1 insertions, 2 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 78684fd50c8..ab45762f868 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -1204,7 +1204,6 @@ typedef struct {
* - nir_texop_txf_ms
* - nir_texop_txs
* - nir_texop_lod
- * - nir_texop_tg4
* - nir_texop_query_levels
* - nir_texop_texture_samples
* - nir_texop_samples_identical
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 45f537024eb..d01f96a5795 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -1755,6 +1755,7 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp opcode,
case nir_texop_txb:
case nir_texop_txl:
case nir_texop_txd:
+ case nir_texop_tg4:
/* These operations require a sampler */
instr->sampler = nir_deref_var_clone(sampler, instr);
break;
@@ -1762,7 +1763,6 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp opcode,
case nir_texop_txf_ms:
case nir_texop_txs:
case nir_texop_lod:
- case nir_texop_tg4:
case nir_texop_query_levels:
case nir_texop_texture_samples:
case nir_texop_samples_identical: