From fde1726af5e8859e671a90811f62041d26e2e219 Mon Sep 17 00:00:00 2001 From: baggins183 Date: Sun, 24 Nov 2024 02:49:59 -0800 Subject: [PATCH] recompiler: fix how srt pass handles step rate sharps in special case (#1587) --- .../ir/passes/flatten_extended_userdata_pass.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/shader_recompiler/ir/passes/flatten_extended_userdata_pass.cpp b/src/shader_recompiler/ir/passes/flatten_extended_userdata_pass.cpp index 6292edfd..ef931989 100644 --- a/src/shader_recompiler/ir/passes/flatten_extended_userdata_pass.cpp +++ b/src/shader_recompiler/ir/passes/flatten_extended_userdata_pass.cpp @@ -148,17 +148,21 @@ static void GenerateSrtProgram(Info& info, PassInfo& pass_info) { // Special case for V# step rate buffers in fetch shader for (const auto [sgpr_base, dword_offset, num_dwords] : info.srt_info.srt_reservations) { // get pointer to V# - c.mov(r10d, ptr[rdi + (sgpr_base << 2)]); - + if (sgpr_base != IR::NumScalarRegs) { + PushPtr(c, sgpr_base); + } u32 src_off = dword_offset << 2; for (auto j = 0; j < num_dwords; j++) { - c.mov(r11d, ptr[r10d + src_off]); + c.mov(r11d, ptr[rdi + src_off]); c.mov(ptr[rsi + (pass_info.dst_off_dw << 2)], r11d); src_off += 4; ++pass_info.dst_off_dw; } + if (sgpr_base != IR::NumScalarRegs) { + PopPtr(c); + } } ASSERT(pass_info.dst_off_dw == info.srt_info.flattened_bufsize_dw);