summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/video_core/shader/decode/xmad.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/video_core/shader/decode/xmad.cpp b/src/video_core/shader/decode/xmad.cpp
index 9f2d636b8..0cd9cd1cc 100644
--- a/src/video_core/shader/decode/xmad.cpp
+++ b/src/video_core/shader/decode/xmad.cpp
@@ -58,18 +58,20 @@ u32 ShaderIR::DecodeXmad(BasicBlock& bb, const BasicBlock& code, u32 pc) {
58 product = Operation(OperationCode::ILogicalShiftLeft, NO_PRECISE, product, Immediate(16)); 58 product = Operation(OperationCode::ILogicalShiftLeft, NO_PRECISE, product, Immediate(16));
59 } 59 }
60 60
61 const Node original_c = op_c;
61 op_c = [&]() { 62 op_c = [&]() {
62 switch (instr.xmad.mode) { 63 switch (instr.xmad.mode) {
63 case Tegra::Shader::XmadMode::None: 64 case Tegra::Shader::XmadMode::None:
64 return op_c; 65 return original_c;
65 case Tegra::Shader::XmadMode::CLo: 66 case Tegra::Shader::XmadMode::CLo:
66 return BitfieldExtract(op_c, 0, 16); 67 return BitfieldExtract(original_c, 0, 16);
67 case Tegra::Shader::XmadMode::CHi: 68 case Tegra::Shader::XmadMode::CHi:
68 return BitfieldExtract(op_c, 16, 16); 69 return BitfieldExtract(original_c, 16, 16);
69 case Tegra::Shader::XmadMode::CBcc: { 70 case Tegra::Shader::XmadMode::CBcc: {
70 const Node shifted_b = SignedOperation(OperationCode::ILogicalShiftLeft, is_signed_b, 71 const Node shifted_b = SignedOperation(OperationCode::ILogicalShiftLeft, is_signed_b,
71 NO_PRECISE, original_b, Immediate(16)); 72 NO_PRECISE, original_b, Immediate(16));
72 return SignedOperation(OperationCode::IAdd, is_signed_c, NO_PRECISE, op_c, shifted_b); 73 return SignedOperation(OperationCode::IAdd, is_signed_c, NO_PRECISE, original_c,
74 shifted_b);
73 } 75 }
74 default: 76 default:
75 UNIMPLEMENTED_MSG("Unhandled XMAD mode: {}", static_cast<u32>(instr.xmad.mode.Value())); 77 UNIMPLEMENTED_MSG("Unhandled XMAD mode: {}", static_cast<u32>(instr.xmad.mode.Value()));