Mesa (main): freedreno/ir3: Handle instr->address when cloning

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Dec 20 20:09:55 UTC 2021


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

Author: Rob Clark <robdclark at chromium.org>
Date:   Wed Dec  1 17:06:20 2021 -0800

freedreno/ir3: Handle instr->address when cloning

Without this, a cloned instruction that takes full regs will trigger an
ir3_validate assert.  This can happen, for ex, if an instruction that
writes p0.x and has a relative src gets cloned in ir3_sched.

Fixes an assert in Genshin Impact with a debug build.

Fixes: 9af795d9b98 ("ir3: Make ir3_instruction::address a normal register")
Signed-off-by: Rob Clark <robdclark at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14231>

---

 src/freedreno/ir3/ir3.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/freedreno/ir3/ir3.c b/src/freedreno/ir3/ir3.c
index 766a7adec7b..162a393110e 100644
--- a/src/freedreno/ir3/ir3.c
+++ b/src/freedreno/ir3/ir3.c
@@ -493,6 +493,11 @@ ir3_instr_clone(struct ir3_instruction *instr)
       *new_reg = *reg;
    }
 
+   if (instr->address) {
+      assert(instr->srcs_count > 0);
+      new_instr->address = new_instr->srcs[instr->srcs_count - 1];
+   }
+
    return new_instr;
 }
 



More information about the mesa-commit mailing list