From: Samuel Pitoiset Date: Thu, 26 Mar 2020 13:14:27 +0000 (+0100) Subject: ac/nir: split 16-bit load/store to global memory on GFX6 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=55fdcc03de8dd7cf62d5b6e3d2369c55e222a822;p=mesa.git ac/nir: split 16-bit load/store to global memory on GFX6 Due to possible alignment issues, make sure to split loads/stores of 16-bit vectors. Doom Eternal requires storageBuffer16BitAccess. Cc: 20.0 Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Part-of: --- diff --git a/src/amd/llvm/ac_nir_to_llvm.c b/src/amd/llvm/ac_nir_to_llvm.c index 84067667ef4..f68253edc89 100644 --- a/src/amd/llvm/ac_nir_to_llvm.c +++ b/src/amd/llvm/ac_nir_to_llvm.c @@ -2342,8 +2342,7 @@ static LLVMValueRef visit_load_var(struct ac_nir_context *ctx, unsigned natural_stride = type_scalar_size_bytes(deref->type); unsigned stride = explicit_stride ? explicit_stride : natural_stride; int elem_size_bytes = ac_get_elem_bits(&ctx->ac, result_type) / 8; - bool split_loads = ctx->ac.chip_class == GFX6 && - elem_size_bytes == 1; + bool split_loads = ctx->ac.chip_class == GFX6 && elem_size_bytes < 4; if (stride != natural_stride || split_loads) { if (LLVMGetTypeKind(result_type) == LLVMVectorTypeKind) @@ -2505,8 +2504,7 @@ visit_store_var(struct ac_nir_context *ctx, unsigned natural_stride = type_scalar_size_bytes(deref->type); unsigned stride = explicit_stride ? explicit_stride : natural_stride; int elem_size_bytes = ac_get_elem_bits(&ctx->ac, LLVMTypeOf(val)) / 8; - bool split_stores = ctx->ac.chip_class == GFX6 && - elem_size_bytes == 1; + bool split_stores = ctx->ac.chip_class == GFX6 && elem_size_bytes < 4; LLVMTypeRef ptr_type = LLVMPointerType(LLVMTypeOf(val), LLVMGetPointerAddressSpace(LLVMTypeOf(address)));