From a1815b1d89ba991eebd4342420e88b157b66a241 Mon Sep 17 00:00:00 2001 From: SDK Chan Date: Wed, 30 Jul 2025 10:43:18 +0000 Subject: [PATCH] [shader_recompiler/Maxwell] Add to ISBERD shift operation --- .../impl/internal_stage_buffer_entry_read.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/internal_stage_buffer_entry_read.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/internal_stage_buffer_entry_read.cpp index 59ca4b15a3..1e56a9e18d 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/internal_stage_buffer_entry_read.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/internal_stage_buffer_entry_read.cpp @@ -46,7 +46,18 @@ void TranslatorVisitor::ISBERD(u64 insn) { throw NotImplementedException("Mode {}", isberd.mode.Value()); } if (isberd.shift != Shift::Default) { - throw NotImplementedException("Shift {}", isberd.shift.Value()); + IR::U32 offset{}; + IR::U32 result{}; + switch(static_cast(isberd.shift.Value())) { + case static_cast(Shift::U16): + offset = static_cast(ir.ShiftLeftLogical(X(isberd.src_reg), ir.Imm32(1))); + break; + case static_cast(Shift::B32): + offset = static_cast(ir.ShiftLeftLogical(X(isberd.src_reg), ir.Imm32(2))); + break; + } + result = ir.IAdd(X(isberd.src_reg), offset); + X(isberd.dest_reg, result); } //LOG_DEBUG(Shader, "(STUBBED) called {}", insn); if (isberd.src_reg_num == 0xFF) {