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

Author: Gert Wollny <[email protected]>
Date:   Sat Jan 21 11:26:55 2023 +0100

r600/sfn: Fix splitting of multislot alu ops

The old source must not incorporate the start slot as lookup
index.

Fixes: commit 573448f93cbbeeae22295e7f943c7120598780d4
  r600/sfn: prepare alu split for use of variable length dot

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8120

Signed-off-by: Gert Wollny <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20826>

---

 src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp 
b/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp
index d778a3465a5..9400e696f87 100644
--- a/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp
+++ b/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp
@@ -752,8 +752,9 @@ AluInstr::split(ValueFactory& vf)
       }
 
       SrcValues src;
-      for (int i = 0; i < alu_ops.at(m_opcode).nsrc; ++i) {
-         auto old_src = m_src[s * alu_ops.at(m_opcode).nsrc + i];
+      int nsrc = alu_ops.at(m_opcode).nsrc;
+      for (int i = 0; i < nsrc; ++i) {
+         auto old_src = m_src[k * nsrc + i];
          // Make it easy for the scheduler and pin the register to the
          // channel, otherwise scheduler would have to check whether a
          // channel switch is possible

Reply via email to