diff options
| author | 2018-12-15 02:07:46 -0300 | |
|---|---|---|
| committer | 2019-01-15 17:54:50 -0300 | |
| commit | abdbafbc203b6dbb8e690d9dda02fc423608401f (patch) | |
| tree | e374aa2bbb7503d567c82a7363fb0297ff0224f4 /src | |
| parent | shader_decode: Implement TMML (diff) | |
| download | yuzu-abdbafbc203b6dbb8e690d9dda02fc423608401f.tar.gz yuzu-abdbafbc203b6dbb8e690d9dda02fc423608401f.tar.xz yuzu-abdbafbc203b6dbb8e690d9dda02fc423608401f.zip | |
shader_decode: Implement PSETP
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/shader/decode/predicate_set_predicate.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/video_core/shader/decode/predicate_set_predicate.cpp b/src/video_core/shader/decode/predicate_set_predicate.cpp index 1ad853fda..24352170d 100644 --- a/src/video_core/shader/decode/predicate_set_predicate.cpp +++ b/src/video_core/shader/decode/predicate_set_predicate.cpp | |||
| @@ -11,12 +11,32 @@ namespace VideoCommon::Shader { | |||
| 11 | 11 | ||
| 12 | using Tegra::Shader::Instruction; | 12 | using Tegra::Shader::Instruction; |
| 13 | using Tegra::Shader::OpCode; | 13 | using Tegra::Shader::OpCode; |
| 14 | using Tegra::Shader::Pred; | ||
| 14 | 15 | ||
| 15 | u32 ShaderIR::DecodePredicateSetPredicate(BasicBlock& bb, u32 pc) { | 16 | u32 ShaderIR::DecodePredicateSetPredicate(BasicBlock& bb, u32 pc) { |
| 16 | const Instruction instr = {program_code[pc]}; | 17 | const Instruction instr = {program_code[pc]}; |
| 17 | const auto opcode = OpCode::Decode(instr); | 18 | const auto opcode = OpCode::Decode(instr); |
| 18 | 19 | ||
| 19 | UNIMPLEMENTED(); | 20 | const Node op_a = GetPredicate(instr.psetp.pred12, instr.psetp.neg_pred12 != 0); |
| 21 | const Node op_b = GetPredicate(instr.psetp.pred29, instr.psetp.neg_pred29 != 0); | ||
| 22 | |||
| 23 | // We can't use the constant predicate as destination. | ||
| 24 | ASSERT(instr.psetp.pred3 != static_cast<u64>(Pred::UnusedIndex)); | ||
| 25 | |||
| 26 | const Node second_pred = GetPredicate(instr.psetp.pred39, instr.psetp.neg_pred39 != 0); | ||
| 27 | |||
| 28 | const OperationCode combiner = GetPredicateCombiner(instr.psetp.op); | ||
| 29 | const Node predicate = Operation(combiner, op_a, op_b); | ||
| 30 | |||
| 31 | // Set the primary predicate to the result of Predicate OP SecondPredicate | ||
| 32 | SetPredicate(bb, instr.psetp.pred3, Operation(combiner, predicate, second_pred)); | ||
| 33 | |||
| 34 | if (instr.psetp.pred0 != static_cast<u64>(Pred::UnusedIndex)) { | ||
| 35 | // Set the secondary predicate to the result of !Predicate OP SecondPredicate, if enabled | ||
| 36 | SetPredicate( | ||
| 37 | bb, instr.psetp.pred0, | ||
| 38 | Operation(combiner, Operation(OperationCode::LogicalNegate, predicate), second_pred)); | ||
| 39 | } | ||
| 20 | 40 | ||
| 21 | return pc; | 41 | return pc; |
| 22 | } | 42 | } |