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>
This commit is contained in:
Samuel Pitoiset
2019-11-11 11:34:05 +01:00
parent 01cae57c80
commit bef7b2f805
+5
View File
@@ -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)