From 3b74e038d20b86ea0395796b76b9343a2ff1a6ee Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Wed, 13 Aug 2025 12:58:33 +0100 Subject: [PATCH] Assert for SPIRV Subgroup Ops that the subgroup is converged --- renderdoc/driver/shaders/spirv/spirv_debug.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/renderdoc/driver/shaders/spirv/spirv_debug.cpp b/renderdoc/driver/shaders/spirv/spirv_debug.cpp index 613435cbc..3b71b126d 100644 --- a/renderdoc/driver/shaders/spirv/spirv_debug.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_debug.cpp @@ -2762,6 +2762,7 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray if(activeMask[lane]) { activeLanes.push_back(lane - firstLaneInSub); + RDCASSERTEQUAL(workgroup[lane - firstLaneInSub].currentInstruction, currentInstruction); } } @@ -3048,6 +3049,7 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray lane = firstLaneInSub + uintComp(GetSrc(group.index), 0); } + RDCASSERTEQUAL(workgroup[lane].currentInstruction, currentInstruction); RDCASSERT(lane < workgroup.size(), lane, workgroup.size()); SetDst(opdata.result, workgroup[lane].GetSrc(value)); break; @@ -3072,6 +3074,7 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray result = false; break; } + RDCASSERTEQUAL(workgroup[quadNeighbours[i]].currentInstruction, currentInstruction); if(opdata.op == Op::GroupNonUniformQuadAllKHR) result = result && workgroup[quadNeighbours[i]].GetSrc(quad.predicate).value.u32v[0]; @@ -3289,6 +3292,7 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray RDCASSERT(lane < workgroup.size(), lane, workgroup.size()); ShaderVariable x = workgroup[lane].GetSrc(valueId); + RDCASSERTEQUAL(workgroup[lane].currentInstruction, currentInstruction); switch(opdata.op) { @@ -3486,6 +3490,7 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray uint32_t bit = 1U << ((lane - firstLaneInSub) % 32U); RDCASSERT(lane < workgroup.size(), lane, workgroup.size()); + RDCASSERTEQUAL(workgroup[lane].currentInstruction, currentInstruction); ShaderVariable x = workgroup[lane].GetSrc(valueId); if(x.value.u32v[0])