From 4283019aa0928f8bf564b0031c21b1231e08f8e2 Mon Sep 17 00:00:00 2001 From: bunnei Date: Wed, 8 Aug 2018 21:51:09 -0400 Subject: gl_shader_decompiler: Declare predicates on use. - Used by Super Mario Odyssey (when going in game). --- src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/video_core') diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index dd240a4ce..ea7779429 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -657,16 +657,17 @@ private: * @param instr Instruction to generate the if condition for. * @returns string containing the predicate condition. */ - std::string GetPredicateCondition(u64 index, bool negate) const { + std::string GetPredicateCondition(u64 index, bool negate) { using Tegra::Shader::Pred; std::string variable; // Index 7 is used as an 'Always True' condition. - if (index == static_cast(Pred::UnusedIndex)) + if (index == static_cast(Pred::UnusedIndex)) { variable = "true"; - else + } else { variable = 'p' + std::to_string(index) + '_' + suffix; - + declr_predicates.insert(variable); + } if (negate) { return "!(" + variable + ')'; } -- cgit v1.2.3