summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2017-10-22 18:32:14 +0200
committerBas Nieuwenhuizen <[email protected]>2017-10-23 00:27:44 +0200
commit2c5b43c87fc4e5dcc50f72d782d7b3718e3c2c1c (patch)
tree6a16acace121fe039566ce30983cea6455b279dd /src
parentda9c3cd3ee5494b43a8ab3f9a3fee95620d9d357 (diff)
ac/nir: Fix nir_texop_lod on GFX for 1D arrays.
Fixes: 1bcb953e166 'radv: handle GFX9 1D textures' Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/common/ac_nir_to_llvm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 360ca81ca89..5e5a46a21f4 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -4747,7 +4747,9 @@ static void visit_tex(struct ac_nir_context *ctx, nir_tex_instr *instr)
filler = LLVMConstReal(ctx->ac.f32, 0.5);
if (instr->sampler_dim == GLSL_SAMPLER_DIM_1D) {
- if (instr->is_array) {
+ /* No nir_texop_lod, because it does not take a slice
+ * even with array textures. */
+ if (instr->is_array && instr->op != nir_texop_lod ) {
address[count] = address[count - 1];
address[count - 1] = filler;
count++;