diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-06-26 02:15:40 +0200 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2019-07-09 14:14:39 +0200 |
commit | 01b21ee1e8e7455dd84ee7f22d33426caaaafdb3 (patch) | |
tree | ed443fde0bf5e5bd140d0f7787c44e87ad5f5505 /src/video_core/shader/decode.cpp | |
parent | shader_ir: Unify blocks in decompiled shaders. (diff) | |
download | yuzu-01b21ee1e8e7455dd84ee7f22d33426caaaafdb3.tar yuzu-01b21ee1e8e7455dd84ee7f22d33426caaaafdb3.tar.gz yuzu-01b21ee1e8e7455dd84ee7f22d33426caaaafdb3.tar.bz2 yuzu-01b21ee1e8e7455dd84ee7f22d33426caaaafdb3.tar.lz yuzu-01b21ee1e8e7455dd84ee7f22d33426caaaafdb3.tar.xz yuzu-01b21ee1e8e7455dd84ee7f22d33426caaaafdb3.tar.zst yuzu-01b21ee1e8e7455dd84ee7f22d33426caaaafdb3.zip |
Diffstat (limited to 'src/video_core/shader/decode.cpp')
-rw-r--r-- | src/video_core/shader/decode.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/video_core/shader/decode.cpp b/src/video_core/shader/decode.cpp index f9b1960da..b4a282cbd 100644 --- a/src/video_core/shader/decode.cpp +++ b/src/video_core/shader/decode.cpp @@ -46,7 +46,7 @@ void ShaderIR::Decode() { coverage_end = shader_info.end; if (shader_info.decompilable) { disable_flow_stack = true; - auto insert_block = ([this](NodeBlock& nodes, u32 label) { + const auto insert_block = ([this](NodeBlock& nodes, u32 label) { if (label == exit_branch) { return; } @@ -88,7 +88,6 @@ void ShaderIR::Decode() { for (u32 label = main_offset; label < shader_end; label++) { basic_blocks.insert({label, DecodeRange(label, label + 1)}); } - return; } NodeBlock ShaderIR::DecodeRange(u32 begin, u32 end) { @@ -104,16 +103,17 @@ void ShaderIR::DecodeRangeInner(NodeBlock& bb, u32 begin, u32 end) { } void ShaderIR::InsertControlFlow(NodeBlock& bb, const ShaderBlock& block) { - auto apply_conditions = ([&](const Condition& cond, Node n) -> Node { + const auto apply_conditions = ([&](const Condition& cond, Node n) -> Node { Node result = n; if (cond.cc != ConditionCode::T) { result = Conditional(GetConditionCode(cond.cc), {result}); } if (cond.predicate != Pred::UnusedIndex) { u32 pred = static_cast<u32>(cond.predicate); - bool is_neg = pred > 7; - if (is_neg) + const bool is_neg = pred > 7; + if (is_neg) { pred -= 8; + } result = Conditional(GetPredicate(pred, is_neg), {result}); } return result; |