diff options
author | Subv <subv2112@gmail.com> | 2018-06-05 02:03:47 +0200 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2018-06-05 03:17:41 +0200 |
commit | 23b1e6eded2d4af99b69d6958314db610ab23cd3 (patch) | |
tree | 14161915d3416ded9edd36c45bbb6ac03f6394da /src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |
parent | GPU: Added decodings for the ISCADD instructions. (diff) | |
download | yuzu-23b1e6eded2d4af99b69d6958314db610ab23cd3.tar yuzu-23b1e6eded2d4af99b69d6958314db610ab23cd3.tar.gz yuzu-23b1e6eded2d4af99b69d6958314db610ab23cd3.tar.bz2 yuzu-23b1e6eded2d4af99b69d6958314db610ab23cd3.tar.lz yuzu-23b1e6eded2d4af99b69d6958314db610ab23cd3.tar.xz yuzu-23b1e6eded2d4af99b69d6958314db610ab23cd3.tar.zst yuzu-23b1e6eded2d4af99b69d6958314db610ab23cd3.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_shader_decompiler.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 9943394c6..30ba9be67 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -884,6 +884,30 @@ private: } break; } + case OpCode::Type::ScaledAdd: { + std::string op_a = regs.GetRegisterAsInteger(instr.gpr8); + + if (instr.iscadd.negate_a) + op_a = '-' + op_a; + + std::string op_b = instr.iscadd.negate_b ? "-" : ""; + + if (instr.is_b_imm) { + op_b += '(' + std::to_string(instr.iscadd.GetImmediate()) + ')'; + } else { + if (instr.is_b_gpr) { + op_b += regs.GetRegisterAsInteger(instr.gpr20); + } else { + op_b += regs.GetUniform(instr.uniform, instr.gpr0); + } + } + + std::string shift = std::to_string(instr.iscadd.shift_amount.Value()); + + regs.SetRegisterToInteger(instr.gpr0, true, 0, + "((" + op_a + " << " + shift + ") + " + op_b + ')', 1, 1); + break; + } case OpCode::Type::Ffma: { std::string op_a = regs.GetRegisterAsFloat(instr.gpr8); std::string op_b = instr.ffma.negate_b ? "-" : ""; |