From af93909c9c3378f8acceba837a7816e1da8181a0 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Fri, 20 Dec 2019 21:36:25 -0300 Subject: 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. --- .../renderer_vulkan/vk_shader_decompiler.cpp | 24 +--------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'src/video_core/renderer_vulkan') 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: } Id operator()(const ExprCondCode& expr) { - const Node cc = decomp.ir.GetConditionCode(expr.cc); - Id target; - - if (const auto pred = std::get_if(&*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(&*cc)) { - target = decomp.internal_flags.at(static_cast(flag->GetFlag())); - } else { - UNREACHABLE(); - } - - return decomp.OpLoad(decomp.t_bool, target); + return decomp.AsBool(decomp.Visit(decomp.ir.GetConditionCode(expr.cc))); } Id operator()(const ExprVar& expr) { -- cgit v1.2.3