From: Samuel Pitoiset Date: Mon, 11 Nov 2019 10:34:05 +0000 (+0100) Subject: ac: handle pointer types to LDS in ac_get_elem_bits() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bef7b2f805f20661733ecc6b6499551d83c512e3;p=mesa.git ac: handle pointer types to LDS in ac_get_elem_bits() This fixes crashes with some dEQP-VK.spirv_assembly.instruction.spirv1p4.* tests. Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák --- 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)