mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-21 22:54:16 +01:00
[spirv] Account for unreachable continue blocks
Fixes code gen in the following pattern encountered in Black Ops 3: loop break endloop We cannot eliminate the loop since we have to adhere to structured control flow rules, which might be broken if the code inside the loop was non-trivial.
This commit is contained in:
parent
427e706a40
commit
d0ea5a4a87
@ -3973,9 +3973,18 @@ namespace dxvk {
|
|||||||
branches.insert({ blockId, ins.arg(i) });
|
branches.insert({ blockId, ins.arg(i) });
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case spv::OpSelectionMerge:
|
case spv::OpSelectionMerge: {
|
||||||
|
mergeBlocks.insert(ins.arg(1));
|
||||||
|
} break;
|
||||||
|
|
||||||
case spv::OpLoopMerge: {
|
case spv::OpLoopMerge: {
|
||||||
mergeBlocks.insert(ins.arg(1));
|
mergeBlocks.insert(ins.arg(1));
|
||||||
|
|
||||||
|
// It is possible for the continue block to be unreachable in
|
||||||
|
// practice, but we still need to emit it if we are not going
|
||||||
|
// to eliminate this loop. Since the current block dominates
|
||||||
|
// the loop, use it to keep the continue block intact.
|
||||||
|
branches.insert({ blockId, ins.arg(2) });
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
default:;
|
default:;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user