diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2018-10-18 07:39:15 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2018-10-23 06:07:20 +0200 |
commit | 7d6dca0d0a5886eb61f8cdc6ac71e2e64d35c633 (patch) | |
tree | 61987647bc578cbdbdb8f12acafd095a8a2a1f58 /src/video_core/renderer_opengl | |
parent | gl_shader_decompiler: Abstract VMAD into a video subset (diff) | |
download | yuzu-7d6dca0d0a5886eb61f8cdc6ac71e2e64d35c633.tar yuzu-7d6dca0d0a5886eb61f8cdc6ac71e2e64d35c633.tar.gz yuzu-7d6dca0d0a5886eb61f8cdc6ac71e2e64d35c633.tar.bz2 yuzu-7d6dca0d0a5886eb61f8cdc6ac71e2e64d35c633.tar.lz yuzu-7d6dca0d0a5886eb61f8cdc6ac71e2e64d35c633.tar.xz yuzu-7d6dca0d0a5886eb61f8cdc6ac71e2e64d35c633.tar.zst yuzu-7d6dca0d0a5886eb61f8cdc6ac71e2e64d35c633.zip |
Diffstat (limited to 'src/video_core/renderer_opengl')
-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 ad4d5a72f..42a072ed9 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -3362,6 +3362,30 @@ private: instr.vmad.cc); break; } + case OpCode::Id::VSETP: { + const std::string op_a = GetVideoOperandA(instr); + const std::string op_b = GetVideoOperandB(instr); + + // We can't use the constant predicate as destination. + ASSERT(instr.vsetp.pred3 != static_cast<u64>(Pred::UnusedIndex)); + + const std::string second_pred = GetPredicateCondition(instr.vsetp.pred39, false); + + const std::string combiner = GetPredicateCombiner(instr.vsetp.op); + + const std::string predicate = GetPredicateComparison(instr.vsetp.cond, op_a, op_b); + // Set the primary predicate to the result of Predicate OP SecondPredicate + SetPredicate(instr.vsetp.pred3, + '(' + predicate + ") " + combiner + " (" + second_pred + ')'); + + if (instr.vsetp.pred0 != static_cast<u64>(Pred::UnusedIndex)) { + // Set the secondary predicate to the result of !Predicate OP SecondPredicate, + // if enabled + SetPredicate(instr.vsetp.pred0, + "!(" + predicate + ") " + combiner + " (" + second_pred + ')'); + } + break; + } default: { LOG_CRITICAL(HW_GPU, "Unhandled instruction: {}", opcode->GetName()); UNREACHABLE(); |