mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-11-03 03:19:58 +00:00
vk_shader_decompiler: Use Visit instead of reimplementing it
ExprCondCode visit implements the generic Visit. Use this instead of that one. As an intended side effect this fixes unwritten memory usages in cases when a negation of a condition code is used.
This commit is contained in:
parent
7be65c6a68
commit
af93909c9c
1 changed files with 1 additions and 23 deletions
|
@ -2552,29 +2552,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
Id operator()(const ExprCondCode& expr) {
|
Id operator()(const ExprCondCode& expr) {
|
||||||
const Node cc = decomp.ir.GetConditionCode(expr.cc);
|
return decomp.AsBool(decomp.Visit(decomp.ir.GetConditionCode(expr.cc)));
|
||||||
Id target;
|
|
||||||
|
|
||||||
if (const auto pred = std::get_if<PredicateNode>(&*cc)) {
|
|
||||||
const auto index = pred->GetIndex();
|
|
||||||
switch (index) {
|
|
||||||
case Tegra::Shader::Pred::NeverExecute:
|
|
||||||
target = decomp.v_false;
|
|
||||||
break;
|
|
||||||
case Tegra::Shader::Pred::UnusedIndex:
|
|
||||||
target = decomp.v_true;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
target = decomp.predicates.at(index);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else if (const auto flag = std::get_if<InternalFlagNode>(&*cc)) {
|
|
||||||
target = decomp.internal_flags.at(static_cast<u32>(flag->GetFlag()));
|
|
||||||
} else {
|
|
||||||
UNREACHABLE();
|
|
||||||
}
|
|
||||||
|
|
||||||
return decomp.OpLoad(decomp.t_bool, target);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Id operator()(const ExprVar& expr) {
|
Id operator()(const ExprVar& expr) {
|
||||||
|
|
Loading…
Reference in a new issue