diff --git a/thirdparty/README.md b/thirdparty/README.md index e094422d7a..916fb2e0a7 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -952,7 +952,7 @@ Files extracted from upstream source: ## re-spirv - Upstream: https://github.com/renderbag/re-spirv -- Version: git (ff2b1a506b0d4310702b5772fff901a626ffaaa1, 2026) +- Version: git (29a77fca357567d00aa37b8ffde19c19cfe477c4, 2026) - License: MIT Files extracted from upstream source: diff --git a/thirdparty/re-spirv/re-spirv.cpp b/thirdparty/re-spirv/re-spirv.cpp index 7f3a246199..1734593139 100644 --- a/thirdparty/re-spirv/re-spirv.cpp +++ b/thirdparty/re-spirv/re-spirv.cpp @@ -2822,13 +2822,13 @@ namespace respv { if (terminatorReduced) { // If there's a selection merge before this branch, we place the unconditional branch in its place. - const uint32_t mergeWordCount = 3; - uint32_t mergeWordIndex = wordIndex - mergeWordCount; + uint32_t mergeInstructionIndex = pInstructionIndex - 1; + uint32_t mergeWordIndex = rContext.shader.instructions[mergeInstructionIndex].wordIndex; SpvOp mergeOpCode = SpvOp(optimizedWords[mergeWordIndex] & 0xFFFFU); uint32_t patchWordIndex; if (mergeOpCode == SpvOpSelectionMerge) { - optimizerReduceLabelDegree(pInstructionIndex, optimizedWords[mergeWordIndex + 1], rContext); + optimizerReduceLabelDegree(mergeInstructionIndex, optimizedWords[mergeWordIndex + 1], rContext); patchWordIndex = mergeWordIndex; } else {