Mesa (master): ac/nir: split 16-bit SSBO stores on GFX6

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 3 08:11:49 UTC 2020


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

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Thu Mar 26 14:14:45 2020 +0100

ac/nir: split 16-bit SSBO stores on GFX6

Due to possible alignment issues, make sure to split stores of
16-bit vectors.

Doom Eternal requires storageBuffer16BitAccess.

Cc: 20.0 <mesa-stable at lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4339>

---

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

diff --git a/src/amd/llvm/ac_nir_to_llvm.c b/src/amd/llvm/ac_nir_to_llvm.c
index f68253edc89..00970638516 100644
--- a/src/amd/llvm/ac_nir_to_llvm.c
+++ b/src/amd/llvm/ac_nir_to_llvm.c
@@ -1741,12 +1741,13 @@ static void visit_store_ssbo(struct ac_nir_context *ctx,
 			num_bytes = 2;
 		}
 
-		/* Due to alignment issues, split stores of 8-bit vectors. */
-		if (ctx->ac.chip_class == GFX6 &&
-                    elem_size_bytes == 1 && count > 1) {
+		/* Due to alignment issues, split stores of 8-bit/16-bit
+		 * vectors.
+		 */
+		if (ctx->ac.chip_class == GFX6 && count > 1 && elem_size_bytes < 4) {
 			writemask |= ((1u << (count - 1)) - 1u) << (start + 1);
 			count = 1;
-			num_bytes = 1;
+			num_bytes = elem_size_bytes;
 		}
 
 		data = extract_vector_range(&ctx->ac, base_data, start, count);



More information about the mesa-commit mailing list