mirror of
https://github.com/yuzu-emu/yuzu-android
synced 2024-12-27 10:51:21 -08:00
shader_ir: Add predicate combiner helper
This commit is contained in:
parent
bf07272695
commit
a58abbcfc4
@ -309,6 +309,18 @@ Node ShaderIR::GetPredicateComparisonHalf(Tegra::Shader::PredCondition condition
|
|||||||
return predicate;
|
return predicate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OperationCode ShaderIR::GetPredicateCombiner(PredOperation operation) {
|
||||||
|
static const std::unordered_map<PredOperation, OperationCode> PredicateOperationTable = {
|
||||||
|
{PredOperation::And, OperationCode::LogicalAnd},
|
||||||
|
{PredOperation::Or, OperationCode::LogicalOr},
|
||||||
|
{PredOperation::Xor, OperationCode::LogicalXor},
|
||||||
|
};
|
||||||
|
|
||||||
|
const auto op = PredicateOperationTable.find(operation);
|
||||||
|
UNIMPLEMENTED_IF_MSG(op == PredicateOperationTable.end(), "Unknown predicate operation");
|
||||||
|
return op->second;
|
||||||
|
}
|
||||||
|
|
||||||
void ShaderIR::SetRegister(BasicBlock& bb, Register dest, Node src) {
|
void ShaderIR::SetRegister(BasicBlock& bb, Register dest, Node src) {
|
||||||
bb.push_back(Operation(OperationCode::Assign, GetRegister(dest), src));
|
bb.push_back(Operation(OperationCode::Assign, GetRegister(dest), src));
|
||||||
}
|
}
|
||||||
|
@ -669,6 +669,9 @@ private:
|
|||||||
Node GetPredicateComparisonHalf(Tegra::Shader::PredCondition condition,
|
Node GetPredicateComparisonHalf(Tegra::Shader::PredCondition condition,
|
||||||
const MetaHalfArithmetic& meta, Node op_a, Node op_b);
|
const MetaHalfArithmetic& meta, Node op_a, Node op_b);
|
||||||
|
|
||||||
|
/// Returns a predicate combiner operation
|
||||||
|
OperationCode GetPredicateCombiner(Tegra::Shader::PredOperation operation);
|
||||||
|
|
||||||
template <typename... T>
|
template <typename... T>
|
||||||
inline Node Operation(OperationCode code, const T*... operands) {
|
inline Node Operation(OperationCode code, const T*... operands) {
|
||||||
return StoreNode(OperationNode(code, operands...));
|
return StoreNode(OperationNode(code, operands...));
|
||||||
|
Loading…
Reference in New Issue
Block a user