From d42d867be446aae8cce5924eba0e0c1f0506584f Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Thu, 3 Apr 2025 09:35:58 +0100 Subject: [PATCH] Minor tidyup of SPIRV controlflow setup Use the first instruction as the starting point not the first block --- renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp b/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp index 300a042c1..9376f5985 100644 --- a/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp +++ b/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp @@ -2471,7 +2471,7 @@ rdcarray Debugger::ContinueDebug() if(steps == 0) { ShaderDebugState initial; - uint32_t startBlock = INVALID_EXECUTION_POINT; + uint32_t startPoint = INVALID_EXECUTION_POINT; // we should be sitting at the entry point function prologue, step forward into the first block // and past any function-local variable declarations @@ -2484,7 +2484,7 @@ rdcarray Debugger::ContinueDebug() thread.EnterEntryPoint(&initial); FillCallstack(thread, initial); initial.nextInstruction = thread.nextInstruction; - startBlock = thread.callstack.back()->curBlock.value(); + startPoint = initial.nextInstruction; } else { @@ -2506,18 +2506,18 @@ rdcarray Debugger::ContinueDebug() ret.push_back(std::move(initial)); - // Set the initial block for the threads in the root tangle + // Set the initial execution point for the threads in the root tangle ThreadExecutionStates threadExecutionStates; TangleGroup &tangles = controlFlow.GetTangles(); RDCASSERTEQUAL(tangles.size(), 1); - RDCASSERTNOTEQUAL(startBlock, INVALID_EXECUTION_POINT); + RDCASSERTNOTEQUAL(startPoint, INVALID_EXECUTION_POINT); for(Tangle &tangle : tangles) { RDCASSERT(tangle.IsAliveActive()); for(uint32_t threadIdx = 0; threadIdx < workgroup.size(); ++threadIdx) { if(!workgroup[threadIdx].Finished()) - threadExecutionStates[threadIdx].push_back(startBlock); + threadExecutionStates[threadIdx].push_back(startPoint); } } controlFlow.UpdateState(threadExecutionStates);