[dxbc] Emit new block only after emitting switch instruction

Otherwise emitting the OpSwitch will reset the block ID, which
is not desireable. Fixes #2975.
This commit is contained in:
Philip Rebohle 2022-10-04 20:59:21 +02:00
parent f8bd19f210
commit ab622760a0
1 changed files with 3 additions and 1 deletions

View File

@ -4009,7 +4009,6 @@ namespace dxvk {
// Close the current 'case' block
m_module.opBranch(block.b_switch.labelBreak);
m_module.opLabel (block.b_switch.labelBreak);
// Insert the 'switch' statement. For that, we need to
// gather all the literal-label pairs for the construct.
@ -4036,6 +4035,9 @@ namespace dxvk {
while (caseLabel != nullptr)
delete std::exchange(caseLabel, caseLabel->next);
// Begin new block after switch blocks
m_module.opLabel(block.b_switch.labelBreak);
}