summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2019-12-20 21:36:25 -0300
committerGravatar ReinUsesLisp2019-12-20 21:36:25 -0300
commitaf93909c9c3378f8acceba837a7816e1da8181a0 (patch)
tree5e923a30f2c9a60aca8dbc57d3313d4218b5e8fb
parentMerge pull request #3234 from ReinUsesLisp/i2f-u8-selector (diff)
downloadyuzu-af93909c9c3378f8acceba837a7816e1da8181a0.tar.gz
yuzu-af93909c9c3378f8acceba837a7816e1da8181a0.tar.xz
yuzu-af93909c9c3378f8acceba837a7816e1da8181a0.zip
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.
-rw-r--r--src/video_core/renderer_vulkan/vk_shader_decompiler.cpp24
1 files changed, 1 insertions, 23 deletions
diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp
index 6227bc70b..fae8c95c8 100644
--- a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp
+++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp
@@ -2552,29 +2552,7 @@ public:
2552 } 2552 }
2553 2553
2554 Id operator()(const ExprCondCode& expr) { 2554 Id operator()(const ExprCondCode& expr) {
2555 const Node cc = decomp.ir.GetConditionCode(expr.cc); 2555 return decomp.AsBool(decomp.Visit(decomp.ir.GetConditionCode(expr.cc)));
2556 Id target;
2557
2558 if (const auto pred = std::get_if<PredicateNode>(&*cc)) {
2559 const auto index = pred->GetIndex();
2560 switch (index) {
2561 case Tegra::Shader::Pred::NeverExecute:
2562 target = decomp.v_false;
2563 break;
2564 case Tegra::Shader::Pred::UnusedIndex:
2565 target = decomp.v_true;
2566 break;
2567 default:
2568 target = decomp.predicates.at(index);
2569 break;
2570 }
2571 } else if (const auto flag = std::get_if<InternalFlagNode>(&*cc)) {
2572 target = decomp.internal_flags.at(static_cast<u32>(flag->GetFlag()));
2573 } else {
2574 UNREACHABLE();
2575 }
2576
2577 return decomp.OpLoad(decomp.t_bool, target);
2578 } 2556 }
2579 2557
2580 Id operator()(const ExprVar& expr) { 2558 Id operator()(const ExprVar& expr) {