mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-03 13:21:12 +00:00
Treat entry point variables consistently with other functions
This commit is contained in:
@@ -474,6 +474,15 @@ void ThreadState::SkipIgnoredInstructions()
|
||||
}
|
||||
}
|
||||
|
||||
void ThreadState::EnterEntryPoint(ShaderDebugState *state)
|
||||
{
|
||||
m_State = state;
|
||||
|
||||
EnterFunction({});
|
||||
|
||||
m_State = NULL;
|
||||
}
|
||||
|
||||
void ThreadState::StepNext(ShaderDebugState *state, const rdcarray<ThreadState> &workgroup)
|
||||
{
|
||||
m_State = state;
|
||||
|
||||
@@ -176,7 +176,7 @@ struct ThreadState
|
||||
ThreadState(uint32_t workgroupIdx, Debugger &debug, const GlobalState &globalState);
|
||||
~ThreadState();
|
||||
|
||||
void EnterFunction(const rdcarray<Id> &arguments);
|
||||
void EnterEntryPoint(ShaderDebugState *state);
|
||||
void StepNext(ShaderDebugState *state, const rdcarray<ThreadState> &workgroup);
|
||||
|
||||
enum DerivDir
|
||||
@@ -238,6 +238,7 @@ struct ThreadState
|
||||
void WritePointerValue(Id pointer, const ShaderVariable &val);
|
||||
|
||||
private:
|
||||
void EnterFunction(const rdcarray<Id> &arguments);
|
||||
void SetDst(Id id, const ShaderVariable &val);
|
||||
void ProcessScopeChange(const rdcarray<Id> &oldLive, const rdcarray<Id> &newLive);
|
||||
void JumpToLabel(Id target);
|
||||
|
||||
@@ -1020,24 +1020,31 @@ rdcarray<ShaderDebugState> Debugger::ContinueDebug()
|
||||
// initialise the first ShaderDebugState if we haven't stepped yet
|
||||
if(steps == 0)
|
||||
{
|
||||
// we should be sitting at the entry point function prologue, step forward into the first block
|
||||
// and past any function-local variable declarations
|
||||
for(ThreadState &thread : workgroup)
|
||||
thread.EnterFunction({});
|
||||
|
||||
ShaderDebugState initial;
|
||||
|
||||
initial.nextInstruction = active.nextInstruction;
|
||||
// we should be sitting at the entry point function prologue, step forward into the first block
|
||||
// and past any function-local variable declarations
|
||||
for(size_t lane = 0; lane < workgroup.size(); lane++)
|
||||
{
|
||||
ThreadState &thread = workgroup[lane];
|
||||
|
||||
for(const Id &v : active.live)
|
||||
if(lane == activeLaneIndex)
|
||||
{
|
||||
thread.EnterEntryPoint(&initial);
|
||||
thread.FillCallstack(initial);
|
||||
initial.nextInstruction = thread.nextInstruction;
|
||||
initial.sourceVars = thread.sourceVars;
|
||||
}
|
||||
else
|
||||
{
|
||||
thread.EnterEntryPoint(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
// globals won't be filled out by entering the entry point, ensure their change is registered.
|
||||
for(const Id &v : liveGlobals)
|
||||
initial.changes.push_back({ShaderVariable(), GetPointerValue(active.ids[v])});
|
||||
|
||||
initial.sourceVars = active.sourceVars;
|
||||
|
||||
initial.stepIndex = steps;
|
||||
|
||||
active.FillCallstack(initial);
|
||||
|
||||
ret.push_back(initial);
|
||||
|
||||
steps++;
|
||||
|
||||
Reference in New Issue
Block a user