Mesa (main): aco: fix SMEM load_global_amd with non-zero offset

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 6 18:09:16 UTC 2022


Module: Mesa
Branch: main
Commit: 4d9f3fcf9cab04c787211b15e645bd28e34a0227
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4d9f3fcf9cab04c787211b15e645bd28e34a0227

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Mon May 30 12:45:10 2022 +0100

aco: fix SMEM load_global_amd with non-zero offset

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof at gmail.com>
Fixes: 3e9517c7577 ("aco: implement _amd global access intrinsics")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16775>

---

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

diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index a81b24bd5ba..7bca54754a8 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -4344,6 +4344,8 @@ smem_load_callback(Builder& bld, const LoadEmitInfo& info, Temp offset, unsigned
       if (offset.id() && const_offset)
          load->operands[1] = bld.sop2(aco_opcode::s_add_u32, bld.def(s1), bld.def(s1, scc), offset,
                                       Operand::c32(const_offset));
+      else if (offset.id())
+         load->operands[1] = Operand(offset);
       else
          load->operands[1] = Operand::c32(const_offset);
    }



More information about the mesa-commit mailing list