summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/maxwell
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2021-04-02 01:17:47 -0300
committerGravatar ameerj2021-07-22 21:51:25 -0400
commitb4a5e767d0a60d44c77460bd3a4062c5f69fb6c7 (patch)
treee365fabb301fba40c7a8e25b072ce59d15105e1d /src/shader_recompiler/frontend/maxwell
parentvulkan: Serialize pipelines on a separate thread (diff)
downloadyuzu-b4a5e767d0a60d44c77460bd3a4062c5f69fb6c7.tar.gz
yuzu-b4a5e767d0a60d44c77460bd3a4062c5f69fb6c7.tar.xz
yuzu-b4a5e767d0a60d44c77460bd3a4062c5f69fb6c7.zip
shader: Fix branches to visited virtual blocks
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell')
-rw-r--r--src/shader_recompiler/frontend/maxwell/control_flow.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/control_flow.cpp b/src/shader_recompiler/frontend/maxwell/control_flow.cpp
index 784f9df8a..ac8707847 100644
--- a/src/shader_recompiler/frontend/maxwell/control_flow.cpp
+++ b/src/shader_recompiler/frontend/maxwell/control_flow.cpp
@@ -486,6 +486,16 @@ Block* CFG::AddLabel(Block* block, Stack stack, Location pc, FunctionId function
486 } 486 }
487 if (const auto it{function.blocks.find(pc, Compare{})}; it != function.blocks.end()) { 487 if (const auto it{function.blocks.find(pc, Compare{})}; it != function.blocks.end()) {
488 // Block already exists and it has been visited 488 // Block already exists and it has been visited
489 if (function.blocks.begin() != it) {
490 // Check if the previous node is the virtual variant of the label
491 // This won't exist if a virtual node is not needed or it hasn't been visited
492 // If it hasn't been visited and a virtual node is needed, this will still behave as
493 // expected because the node impersonated with its virtual node.
494 const auto prev{std::prev(it)};
495 if (it->begin.Virtual() == prev->begin) {
496 return &*prev;
497 }
498 }
489 return &*it; 499 return &*it;
490 } 500 }
491 Block* const new_block{block_pool.Create(Block{ 501 Block* const new_block{block_pool.Create(Block{