1D textures are allocated as 2D which means we only need
one coordinate for texture query LOD.
Fixes: 625dcbbc456 ("amd/common: pass address components individually to
ac_build_image_intrinsic")
Cc: 18.1 <[email protected]>
Signed-off-by: Samuel Pitoiset <[email protected]>
---
src/amd/common/ac_llvm_build.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index f21a5d2623c..be7379f72ef 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -1533,6 +1533,16 @@ LLVMValueRef ac_build_image_opcode(struct
ac_llvm_context *ctx,
default:
break;
}
+
+ /* Fixup for GFX9 which allocates 1D textures as 2D, because at
+ * this point we don't know the orignal sampler dimension.
+ */
+ if (ctx->chip_class >= GFX9) {
+ if ((a->dim == ac_image_2darray ||
+ a->dim == ac_image_2d) && !a->coords[1]) {
+ num_coords = 1;
+ }
+ }
}
if (a->offset)
--
2.17.0
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev