diff options
author | bunnei <bunneidev@gmail.com> | 2018-06-05 02:48:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-05 02:48:15 +0200 |
commit | e8bfff7b4bee1472ae618cecb52343a41be39b8b (patch) | |
tree | 69b5926ccdfbc50eeb46737488ae8fe696fa090c /src/video_core/renderer_opengl | |
parent | Merge pull request #510 from Subv/isetp (diff) | |
parent | GPU: Implemented the LOP32I instruction. (diff) | |
download | yuzu-e8bfff7b4bee1472ae618cecb52343a41be39b8b.tar yuzu-e8bfff7b4bee1472ae618cecb52343a41be39b8b.tar.gz yuzu-e8bfff7b4bee1472ae618cecb52343a41be39b8b.tar.bz2 yuzu-e8bfff7b4bee1472ae618cecb52343a41be39b8b.tar.lz yuzu-e8bfff7b4bee1472ae618cecb52343a41be39b8b.tar.xz yuzu-e8bfff7b4bee1472ae618cecb52343a41be39b8b.tar.zst yuzu-e8bfff7b4bee1472ae618cecb52343a41be39b8b.zip |
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 43 |
1 files changed, 43 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 8c263f15f..9943394c6 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -841,6 +841,49 @@ private: } break; } + case OpCode::Type::Logic: { + std::string op_a = regs.GetRegisterAsInteger(instr.gpr8, 0, false); + + if (instr.alu.lop.invert_a) + op_a = "~(" + op_a + ')'; + + switch (opcode->GetId()) { + case OpCode::Id::LOP32I: { + u32 imm = static_cast<u32>(instr.alu.imm20_32.Value()); + + if (instr.alu.lop.invert_b) + imm = ~imm; + + switch (instr.alu.lop.operation) { + case Tegra::Shader::LogicOperation::And: { + regs.SetRegisterToInteger(instr.gpr0, false, 0, + '(' + op_a + " & " + std::to_string(imm) + ')', 1, 1); + break; + } + case Tegra::Shader::LogicOperation::Or: { + regs.SetRegisterToInteger(instr.gpr0, false, 0, + '(' + op_a + " | " + std::to_string(imm) + ')', 1, 1); + break; + } + case Tegra::Shader::LogicOperation::Xor: { + regs.SetRegisterToInteger(instr.gpr0, false, 0, + '(' + op_a + " ^ " + std::to_string(imm) + ')', 1, 1); + break; + } + default: + NGLOG_CRITICAL(HW_GPU, "Unimplemented lop32i operation: {}", + static_cast<u32>(instr.alu.lop.operation.Value())); + UNREACHABLE(); + } + break; + } + default: { + NGLOG_CRITICAL(HW_GPU, "Unhandled logic instruction: {}", opcode->GetName()); + UNREACHABLE(); + } + } + break; + } case OpCode::Type::Ffma: { std::string op_a = regs.GetRegisterAsFloat(instr.gpr8); std::string op_b = instr.ffma.negate_b ? "-" : ""; |