diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-09-24 16:57:45 +0200 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2019-10-05 00:52:55 +0200 |
commit | 000ad558dd21a0f1f0be57ddbb59540956314896 (patch) | |
tree | a4ea12c3500f86e139a6da600133ba8c4dcb66bc /src/video_core/renderer_vulkan | |
parent | Shader_IR: clean up AST handling and add documentation. (diff) | |
download | yuzu-000ad558dd21a0f1f0be57ddbb59540956314896.tar yuzu-000ad558dd21a0f1f0be57ddbb59540956314896.tar.gz yuzu-000ad558dd21a0f1f0be57ddbb59540956314896.tar.bz2 yuzu-000ad558dd21a0f1f0be57ddbb59540956314896.tar.lz yuzu-000ad558dd21a0f1f0be57ddbb59540956314896.tar.xz yuzu-000ad558dd21a0f1f0be57ddbb59540956314896.tar.zst yuzu-000ad558dd21a0f1f0be57ddbb59540956314896.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp index 11effe4a1..4bc7da198 100644 --- a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp +++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp @@ -1659,12 +1659,12 @@ public: } void operator()(VideoCommon::Shader::ExprPredicate& expr) { - auto pred = static_cast<Tegra::Shader::Pred>(expr.predicate); + const auto pred = static_cast<Tegra::Shader::Pred>(expr.predicate); current_id = decomp.Emit(decomp.OpLoad(decomp.t_bool, decomp.predicates.at(pred))); } void operator()(VideoCommon::Shader::ExprCondCode& expr) { - Node cc = decomp.ir.GetConditionCode(expr.cc); + const Node cc = decomp.ir.GetConditionCode(expr.cc); Id target; if (const auto pred = std::get_if<PredicateNode>(&*cc)) { @@ -1785,8 +1785,7 @@ public: } void operator()(VideoCommon::Shader::ASTReturn& ast) { - bool is_true = VideoCommon::Shader::ExprIsTrue(ast.condition); - if (!is_true) { + if (!VideoCommon::Shader::ExprIsTrue(ast.condition)) { ExprDecompiler expr_parser{decomp}; const Id condition = expr_parser.Visit(ast.condition); const Id then_label = decomp.OpLabel(); @@ -1816,8 +1815,7 @@ public: } void operator()(VideoCommon::Shader::ASTBreak& ast) { - bool is_true = VideoCommon::Shader::ExprIsTrue(ast.condition); - if (!is_true) { + if (!VideoCommon::Shader::ExprIsTrue(ast.condition)) { ExprDecompiler expr_parser{decomp}; const Id condition = expr_parser.Visit(ast.condition); const Id then_label = decomp.OpLabel(); @@ -1846,7 +1844,7 @@ private: }; void SPIRVDecompiler::DecompileAST() { - u32 num_flow_variables = ir.GetASTNumVariables(); + const u32 num_flow_variables = ir.GetASTNumVariables(); for (u32 i = 0; i < num_flow_variables; i++) { const Id id = OpVariable(t_prv_bool, spv::StorageClass::Private, v_false); Name(id, fmt::format("flow_var_{}", i)); |