Mesa (master): aco: fix alignment of vectors with 4 elements

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 9 21:50:58 UTC 2020


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

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Mon May 25 18:33:18 2020 +0200

aco: fix alignment of vectors with 4 elements

I think this case was just missing.

This fixes a bunch of 16-bit storage related CTS failures like
dEQP-VK.ssbo.phys.layout.single_basic_type.std430.u16vec4.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>
Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5226>

---

 src/amd/compiler/aco_instruction_selection.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index 66f6c8857e2..76462b1b23b 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -3027,9 +3027,12 @@ void byte_align_vector(isel_context *ctx, Temp vec, Operand offset, Temp dst)
 {
    Builder bld(ctx->program, ctx->block);
    if (offset.isTemp()) {
-      Temp tmp[3] = {vec, vec, vec};
+      Temp tmp[4] = {vec, vec, vec, vec};
 
-      if (vec.size() == 3) {
+      if (vec.size() == 4) {
+         tmp[0] = bld.tmp(v1), tmp[1] = bld.tmp(v1), tmp[2] = bld.tmp(v1), tmp[3] = bld.tmp(v1);
+         bld.pseudo(aco_opcode::p_split_vector, Definition(tmp[0]), Definition(tmp[1]), Definition(tmp[2]), Definition(tmp[3]), vec);
+      } else if (vec.size() == 3) {
          tmp[0] = bld.tmp(v1), tmp[1] = bld.tmp(v1), tmp[2] = bld.tmp(v1);
          bld.pseudo(aco_opcode::p_split_vector, Definition(tmp[0]), Definition(tmp[1]), Definition(tmp[2]), vec);
       } else if (vec.size() == 2) {



More information about the mesa-commit mailing list