From bef7b2f805f20661733ecc6b6499551d83c512e3 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Mon, 11 Nov 2019 11:34:05 +0100 Subject: ac: handle pointer types to LDS in ac_get_elem_bits() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes crashes with some dEQP-VK.spirv_assembly.instruction.spirv1p4.* tests. Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák --- src/amd/llvm/ac_llvm_build.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/amd/llvm/ac_llvm_build.c b/src/amd/llvm/ac_llvm_build.c index ece2b3f42cb..4515f696e74 100644 --- a/src/amd/llvm/ac_llvm_build.c +++ b/src/amd/llvm/ac_llvm_build.c @@ -177,6 +177,11 @@ ac_get_elem_bits(struct ac_llvm_context *ctx, LLVMTypeRef type) if (LLVMGetTypeKind(type) == LLVMIntegerTypeKind) return LLVMGetIntTypeWidth(type); + if (LLVMGetTypeKind(type) == LLVMPointerTypeKind) { + if (LLVMGetPointerAddressSpace(type) == AC_ADDR_SPACE_LDS) + return 32; + } + if (type == ctx->f16) return 16; if (type == ctx->f32) -- cgit v1.2.3