diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/shader/shader_ir.cpp | 12 | ||||
| -rw-r--r-- | src/video_core/shader/shader_ir.h | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/video_core/shader/shader_ir.cpp b/src/video_core/shader/shader_ir.cpp index 20a1a50ef..aec1fb36b 100644 --- a/src/video_core/shader/shader_ir.cpp +++ b/src/video_core/shader/shader_ir.cpp | |||
| @@ -309,6 +309,18 @@ Node ShaderIR::GetPredicateComparisonHalf(Tegra::Shader::PredCondition condition | |||
| 309 | return predicate; | 309 | return predicate; |
| 310 | } | 310 | } |
| 311 | 311 | ||
| 312 | OperationCode ShaderIR::GetPredicateCombiner(PredOperation operation) { | ||
| 313 | static const std::unordered_map<PredOperation, OperationCode> PredicateOperationTable = { | ||
| 314 | {PredOperation::And, OperationCode::LogicalAnd}, | ||
| 315 | {PredOperation::Or, OperationCode::LogicalOr}, | ||
| 316 | {PredOperation::Xor, OperationCode::LogicalXor}, | ||
| 317 | }; | ||
| 318 | |||
| 319 | const auto op = PredicateOperationTable.find(operation); | ||
| 320 | UNIMPLEMENTED_IF_MSG(op == PredicateOperationTable.end(), "Unknown predicate operation"); | ||
| 321 | return op->second; | ||
| 322 | } | ||
| 323 | |||
| 312 | void ShaderIR::SetRegister(BasicBlock& bb, Register dest, Node src) { | 324 | void ShaderIR::SetRegister(BasicBlock& bb, Register dest, Node src) { |
| 313 | bb.push_back(Operation(OperationCode::Assign, GetRegister(dest), src)); | 325 | bb.push_back(Operation(OperationCode::Assign, GetRegister(dest), src)); |
| 314 | } | 326 | } |
diff --git a/src/video_core/shader/shader_ir.h b/src/video_core/shader/shader_ir.h index 372ed10da..f13129ab3 100644 --- a/src/video_core/shader/shader_ir.h +++ b/src/video_core/shader/shader_ir.h | |||
| @@ -669,6 +669,9 @@ private: | |||
| 669 | Node GetPredicateComparisonHalf(Tegra::Shader::PredCondition condition, | 669 | Node GetPredicateComparisonHalf(Tegra::Shader::PredCondition condition, |
| 670 | const MetaHalfArithmetic& meta, Node op_a, Node op_b); | 670 | const MetaHalfArithmetic& meta, Node op_a, Node op_b); |
| 671 | 671 | ||
| 672 | /// Returns a predicate combiner operation | ||
| 673 | OperationCode GetPredicateCombiner(Tegra::Shader::PredOperation operation); | ||
| 674 | |||
| 672 | template <typename... T> | 675 | template <typename... T> |
| 673 | inline Node Operation(OperationCode code, const T*... operands) { | 676 | inline Node Operation(OperationCode code, const T*... operands) { |
| 674 | return StoreNode(OperationNode(code, operands...)); | 677 | return StoreNode(OperationNode(code, operands...)); |