From 19f299714a451886ea4610807c994a2933391923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Miko=C5=82ajczyk?= Date: Sat, 23 May 2026 23:40:58 +0200 Subject: [PATCH] Handle abs and clamp modifiers only for VOP3A instructions (#4467) --- src/shader_recompiler/frontend/decode.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/shader_recompiler/frontend/decode.cpp b/src/shader_recompiler/frontend/decode.cpp index 4f71e1caf..c1d07c581 100644 --- a/src/shader_recompiler/frontend/decode.cpp +++ b/src/shader_recompiler/frontend/decode.cpp @@ -802,11 +802,19 @@ void GcnDecodeContext::decodeInstructionVOP3(uint64_t hexInstruction) { // update input modifier auto& control = m_instruction.control.vop3; - for (u32 i = 0; i != 3; ++i) { - if (control.abs & (1u << i)) { - m_instruction.src[i].input_modifier.abs = true; - } + // update output modifier + auto& outputMod = m_instruction.dst[0].output_modifier; + + if (!IsVop3BEncoding(m_instruction.opcode)) { + for (u32 i = 0; i != 3; ++i) { + if (control.abs & (1u << i)) { + m_instruction.src[i].input_modifier.abs = true; + } + } + outputMod.clamp = static_cast(control.clmp); + } + for (u32 i = 0; i != 3; ++i) { if (control.neg & (1u << i)) { m_instruction.src[i].input_modifier.neg = true; } @@ -818,10 +826,6 @@ void GcnDecodeContext::decodeInstructionVOP3(uint64_t hexInstruction) { m_instruction.dst[0].op_sel.op_sel = control.op_sel & (1u << 3); - // update output modifier - auto& outputMod = m_instruction.dst[0].output_modifier; - - outputMod.clamp = static_cast(control.clmp); switch (control.omod) { case 0: outputMod.multiplier = 0.f;