diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-01-04 19:40:57 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-01-04 19:40:57 +0100 |
commit | 3dd6b55851978440f39487a6ad06b30b792b3b36 (patch) | |
tree | d5019053dc20d420181443ff90207aab2ff28938 /src/video_core/renderer_opengl | |
parent | Shader_IR: add the ability to amend code in the shader ir. (diff) | |
download | yuzu-3dd6b55851978440f39487a6ad06b30b792b3b36.tar yuzu-3dd6b55851978440f39487a6ad06b30b792b3b36.tar.gz yuzu-3dd6b55851978440f39487a6ad06b30b792b3b36.tar.bz2 yuzu-3dd6b55851978440f39487a6ad06b30b792b3b36.tar.lz yuzu-3dd6b55851978440f39487a6ad06b30b792b3b36.tar.xz yuzu-3dd6b55851978440f39487a6ad06b30b792b3b36.tar.zst yuzu-3dd6b55851978440f39487a6ad06b30b792b3b36.zip |
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index e1730821f..f9f7a97b5 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -751,10 +751,8 @@ private: Expression Visit(const Node& node) { if (const auto operation = std::get_if<OperationNode>(&*node)) { - auto amend_index = operation->GetAmendIndex(); - if (amend_index) { - const Node& amend_node = ir.GetAmendNode(*amend_index); - Visit(amend_node).CheckVoid(); + if (const auto amend_index = operation->GetAmendIndex()) { + Visit(ir.GetAmendNode(*amend_index)).CheckVoid(); } const auto operation_index = static_cast<std::size_t>(operation->GetCode()); if (operation_index >= operation_decompilers.size()) { @@ -877,10 +875,8 @@ private: } if (const auto conditional = std::get_if<ConditionalNode>(&*node)) { - auto amend_index = conditional->GetAmendIndex(); - if (amend_index) { - const Node& amend_node = ir.GetAmendNode(*amend_index); - Visit(amend_node).CheckVoid(); + if (const auto amend_index = conditional->GetAmendIndex()) { + Visit(ir.GetAmendNode(*amend_index)).CheckVoid(); } // It's invalid to call conditional on nested nodes, use an operation instead code.AddLine("if ({}) {{", Visit(conditional->GetCondition()).AsBool()); @@ -894,11 +890,6 @@ private: } if (const auto comment = std::get_if<CommentNode>(&*node)) { - auto amend_index = comment->GetAmendIndex(); - if (amend_index) { - const Node& amend_node = ir.GetAmendNode(*amend_index); - Visit(amend_node).CheckVoid(); - } code.AddLine("// " + comment->GetText()); return {}; } |