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 <mesa-stable@lists.freedesktop.org> Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4339>
This commit is contained in:
parent
7308f2e912
commit
55fdcc03de
|
@ -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)));
|
||||
|
|
Loading…
Reference in New Issue