diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-05-14 22:16:23 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-07-20 03:20:47 +0200 |
commit | 6c4985edc9e05dbd9a93ba670625daee98c14bcf (patch) | |
tree | 04fa84dcbc2401f09c6daf2db839bbd5df9f9ef2 /src/video_core/shader/decode | |
parent | Merge pull request #2687 from lioncash/tls-process (diff) | |
download | yuzu-6c4985edc9e05dbd9a93ba670625daee98c14bcf.tar yuzu-6c4985edc9e05dbd9a93ba670625daee98c14bcf.tar.gz yuzu-6c4985edc9e05dbd9a93ba670625daee98c14bcf.tar.bz2 yuzu-6c4985edc9e05dbd9a93ba670625daee98c14bcf.tar.lz yuzu-6c4985edc9e05dbd9a93ba670625daee98c14bcf.tar.xz yuzu-6c4985edc9e05dbd9a93ba670625daee98c14bcf.tar.zst yuzu-6c4985edc9e05dbd9a93ba670625daee98c14bcf.zip |
Diffstat (limited to 'src/video_core/shader/decode')
-rw-r--r-- | src/video_core/shader/decode/half_set_predicate.cpp | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/src/video_core/shader/decode/half_set_predicate.cpp b/src/video_core/shader/decode/half_set_predicate.cpp index d59d15bd8..ff41fb2b5 100644 --- a/src/video_core/shader/decode/half_set_predicate.cpp +++ b/src/video_core/shader/decode/half_set_predicate.cpp @@ -23,17 +23,33 @@ u32 ShaderIR::DecodeHalfSetPredicate(NodeBlock& bb, u32 pc) { Node op_a = UnpackHalfFloat(GetRegister(instr.gpr8), instr.hsetp2.type_a); op_a = GetOperandAbsNegHalf(op_a, instr.hsetp2.abs_a, instr.hsetp2.negate_a); - Node op_b = [&]() { - switch (opcode->get().GetId()) { - case OpCode::Id::HSETP2_R: - return GetOperandAbsNegHalf(GetRegister(instr.gpr20), instr.hsetp2.abs_a, - instr.hsetp2.negate_b); - default: - UNREACHABLE(); - return Immediate(0); - } - }(); - op_b = UnpackHalfFloat(op_b, instr.hsetp2.type_b); + Tegra::Shader::PredCondition cond{}; + bool h_and{}; + Node op_b{}; + switch (opcode->get().GetId()) { + case OpCode::Id::HSETP2_C: + cond = instr.hsetp2.cbuf_and_imm.cond; + h_and = instr.hsetp2.cbuf_and_imm.h_and; + op_b = GetOperandAbsNegHalf(GetConstBuffer(instr.cbuf34.index, instr.cbuf34.offset), + instr.hsetp2.cbuf.abs_b, instr.hsetp2.cbuf.negate_b); + break; + case OpCode::Id::HSETP2_IMM: + cond = instr.hsetp2.cbuf_and_imm.cond; + h_and = instr.hsetp2.cbuf_and_imm.h_and; + op_b = UnpackHalfImmediate(instr, true); + break; + case OpCode::Id::HSETP2_R: + cond = instr.hsetp2.reg.cond; + h_and = instr.hsetp2.reg.h_and; + op_b = + UnpackHalfFloat(GetOperandAbsNegHalf(GetRegister(instr.gpr20), instr.hsetp2.reg.abs_b, + instr.hsetp2.reg.negate_b), + instr.hsetp2.reg.type_b); + break; + default: + UNREACHABLE(); + op_b = Immediate(0); + } // We can't use the constant predicate as destination. ASSERT(instr.hsetp2.pred3 != static_cast<u64>(Pred::UnusedIndex)); @@ -42,9 +58,9 @@ u32 ShaderIR::DecodeHalfSetPredicate(NodeBlock& bb, u32 pc) { const OperationCode combiner = GetPredicateCombiner(instr.hsetp2.op); const OperationCode pair_combiner = - instr.hsetp2.h_and ? OperationCode::LogicalAll2 : OperationCode::LogicalAny2; + h_and ? OperationCode::LogicalAll2 : OperationCode::LogicalAny2; - const Node comparison = GetPredicateComparisonHalf(instr.hsetp2.cond, op_a, op_b); + const Node comparison = GetPredicateComparisonHalf(cond, op_a, op_b); const Node first_pred = Operation(pair_combiner, comparison); // Set the primary predicate to the result of Predicate OP SecondPredicate |