[Mesa-dev] [PATCH] ac: fix the number of coordinates for ac_image_get_lod and arrays

Samuel Pitoiset samuel.pitoiset at gmail.com
Mon Apr 23 15:52:09 UTC 2018


This fixes crashes for the following CTS:
dEQP-VK.glsl.texture_functions.query.texturequerylod.*

Fixes: 625dcbbc456 ("amd/common: pass address components individually to
ac_build_image_intrinsic")
Cc: 18.1 <mesa-stable at lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/amd/common/ac_llvm_build.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index 02739f9da9c..d5bad3eeea3 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -1521,6 +1521,19 @@ LLVMValueRef ac_build_image_opcode(struct ac_llvm_context *ctx,
 	LLVMValueRef addr;
 	unsigned num_addr = 0;
 
+	if (a->opcode == ac_image_get_lod) {
+		switch (a->dim) {
+		case ac_image_1darray:
+			num_coords = 1;
+			break;
+		case ac_image_2darray:
+			num_coords = 2;
+			break;
+		default:
+			break;
+		}
+	}
+
 	if (a->offset)
 		args[num_addr++] = ac_to_integer(ctx, a->offset);
 	if (a->bias)
-- 
2.17.0



More information about the mesa-dev mailing list