diff options
Diffstat (limited to 'src/video_core/shader')
| -rw-r--r-- | src/video_core/shader/control_flow.cpp | 10 | ||||
| -rw-r--r-- | src/video_core/shader/decode.cpp | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/video_core/shader/control_flow.cpp b/src/video_core/shader/control_flow.cpp index 9120bf705..43d965f2f 100644 --- a/src/video_core/shader/control_flow.cpp +++ b/src/video_core/shader/control_flow.cpp | |||
| @@ -257,7 +257,7 @@ std::pair<ParseResult, ParseInfo> ParseCode(CFGRebuildState& state, u32 address) | |||
| 257 | single_branch.ignore = false; | 257 | single_branch.ignore = false; |
| 258 | break; | 258 | break; |
| 259 | } | 259 | } |
| 260 | if (state.registered.count(offset) != 0) { | 260 | if (state.registered.contains(offset)) { |
| 261 | single_branch.address = offset; | 261 | single_branch.address = offset; |
| 262 | single_branch.ignore = true; | 262 | single_branch.ignore = true; |
| 263 | break; | 263 | break; |
| @@ -632,12 +632,12 @@ void DecompileShader(CFGRebuildState& state) { | |||
| 632 | for (auto label : state.labels) { | 632 | for (auto label : state.labels) { |
| 633 | state.manager->DeclareLabel(label); | 633 | state.manager->DeclareLabel(label); |
| 634 | } | 634 | } |
| 635 | for (auto& block : state.block_info) { | 635 | for (const auto& block : state.block_info) { |
| 636 | if (state.labels.count(block.start) != 0) { | 636 | if (state.labels.contains(block.start)) { |
| 637 | state.manager->InsertLabel(block.start); | 637 | state.manager->InsertLabel(block.start); |
| 638 | } | 638 | } |
| 639 | const bool ignore = BlockBranchIsIgnored(block.branch); | 639 | const bool ignore = BlockBranchIsIgnored(block.branch); |
| 640 | u32 end = ignore ? block.end + 1 : block.end; | 640 | const u32 end = ignore ? block.end + 1 : block.end; |
| 641 | state.manager->InsertBlock(block.start, end); | 641 | state.manager->InsertBlock(block.start, end); |
| 642 | if (!ignore) { | 642 | if (!ignore) { |
| 643 | InsertBranch(*state.manager, block.branch); | 643 | InsertBranch(*state.manager, block.branch); |
| @@ -737,7 +737,7 @@ std::unique_ptr<ShaderCharacteristics> ScanFlow(const ProgramCode& program_code, | |||
| 737 | auto back = result_out->blocks.begin(); | 737 | auto back = result_out->blocks.begin(); |
| 738 | auto next = std::next(back); | 738 | auto next = std::next(back); |
| 739 | while (next != result_out->blocks.end()) { | 739 | while (next != result_out->blocks.end()) { |
| 740 | if (state.labels.count(next->start) == 0 && next->start == back->end + 1) { | 740 | if (!state.labels.contains(next->start) && next->start == back->end + 1) { |
| 741 | back->end = next->end; | 741 | back->end = next->end; |
| 742 | next = result_out->blocks.erase(next); | 742 | next = result_out->blocks.erase(next); |
| 743 | continue; | 743 | continue; |
diff --git a/src/video_core/shader/decode.cpp b/src/video_core/shader/decode.cpp index c8f4da6df..ab14c1aa3 100644 --- a/src/video_core/shader/decode.cpp +++ b/src/video_core/shader/decode.cpp | |||
| @@ -153,8 +153,8 @@ void ShaderIR::Decode() { | |||
| 153 | const auto& blocks = shader_info.blocks; | 153 | const auto& blocks = shader_info.blocks; |
| 154 | NodeBlock current_block; | 154 | NodeBlock current_block; |
| 155 | u32 current_label = static_cast<u32>(exit_branch); | 155 | u32 current_label = static_cast<u32>(exit_branch); |
| 156 | for (auto& block : blocks) { | 156 | for (const auto& block : blocks) { |
| 157 | if (shader_info.labels.count(block.start) != 0) { | 157 | if (shader_info.labels.contains(block.start)) { |
| 158 | insert_block(current_block, current_label); | 158 | insert_block(current_block, current_label); |
| 159 | current_block.clear(); | 159 | current_block.clear(); |
| 160 | current_label = block.start; | 160 | current_label = block.start; |