summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2019-11-11 11:34:05 +0100
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>2019-11-12 08:32:15 +0100
commitbef7b2f805f20661733ecc6b6499551d83c512e3 (patch)
treebd7e9e1d24d7efa9641003879333e7ce77830301
parent01cae57c80839fcb0defc76f450f1938e96e8ae7 (diff)
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 <samuel.pitoiset@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
-rw-r--r--src/amd/llvm/ac_llvm_build.c5
1 files changed, 5 insertions, 0 deletions
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)