From ab622760a0f55c336a4fb3170cce84c10277af3e Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Tue, 4 Oct 2022 20:59:21 +0200 Subject: [PATCH] [dxbc] Emit new block only after emitting switch instruction Otherwise emitting the OpSwitch will reset the block ID, which is not desireable. Fixes #2975. --- src/dxbc/dxbc_compiler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index ed5e7533c..0514e0afe 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -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); }