[Mesa-dev] [PATCH 1/2] ac/nir: Fix nir_texop_lod on GFX for 1D arrays.

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Sun Oct 22 16:43:52 UTC 2017


Fixes: 1bcb953e166 'radv: handle GFX9 1D textures'
---
 src/amd/common/ac_nir_to_llvm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 83b49b535c6..473dd67355b 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++;
-- 
2.14.2



More information about the mesa-dev mailing list