diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-01-16 01:06:05 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-01-16 01:06:05 +0100 |
commit | a63d7c49fc928d0ad440213a5a409a2f1f05afed (patch) | |
tree | 32d45d9b683587b230472714e0e1e0b451e7a25c /src/video_core/shader/decode/xmad.cpp | |
parent | gl_shader_decompiler: replace std::get<> with std::get_if<> for macOS compatibility (diff) | |
download | yuzu-a63d7c49fc928d0ad440213a5a409a2f1f05afed.tar yuzu-a63d7c49fc928d0ad440213a5a409a2f1f05afed.tar.gz yuzu-a63d7c49fc928d0ad440213a5a409a2f1f05afed.tar.bz2 yuzu-a63d7c49fc928d0ad440213a5a409a2f1f05afed.tar.lz yuzu-a63d7c49fc928d0ad440213a5a409a2f1f05afed.tar.xz yuzu-a63d7c49fc928d0ad440213a5a409a2f1f05afed.tar.zst yuzu-a63d7c49fc928d0ad440213a5a409a2f1f05afed.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/shader/decode/xmad.cpp | 10 |
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) { product = Operation(OperationCode::ILogicalShiftLeft, NO_PRECISE, product, Immediate(16)); } + const Node original_c = op_c; op_c = [&]() { switch (instr.xmad.mode) { case Tegra::Shader::XmadMode::None: - return op_c; + return original_c; case Tegra::Shader::XmadMode::CLo: - return BitfieldExtract(op_c, 0, 16); + return BitfieldExtract(original_c, 0, 16); case Tegra::Shader::XmadMode::CHi: - return BitfieldExtract(op_c, 16, 16); + return BitfieldExtract(original_c, 16, 16); case Tegra::Shader::XmadMode::CBcc: { const Node shifted_b = SignedOperation(OperationCode::ILogicalShiftLeft, is_signed_b, NO_PRECISE, original_b, Immediate(16)); - return SignedOperation(OperationCode::IAdd, is_signed_c, NO_PRECISE, op_c, shifted_b); + return SignedOperation(OperationCode::IAdd, is_signed_c, NO_PRECISE, original_c, + shifted_b); } default: UNIMPLEMENTED_MSG("Unhandled XMAD mode: {}", static_cast<u32>(instr.xmad.mode.Value())); |