Module: Mesa
Branch: master
Commit: 55fdcc03de8dd7cf62d5b6e3d2369c55e222a822
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=55fdcc03de8dd7cf62d5b6e3d2369c55e222a822

Author: Samuel Pitoiset <[email protected]>
Date:   Thu Mar 26 14:14:27 2020 +0100

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 <[email protected]>
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4339>

---

 src/amd/llvm/ac_nir_to_llvm.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

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)));

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to