mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 13:20:54 +00:00
Rationalise DXIL debugger instruction indexes
Use m_ActiveGlobalInstructionIdx instead of m_GlobalInstructionIdx Removed m_GlobalInstructionIdx
This commit is contained in:
@@ -1656,7 +1656,7 @@ ThreadState::ThreadState(uint32_t workgroupIndex, Debugger &debugger,
|
||||
m_WorkgroupIndex = workgroupIndex;
|
||||
m_FunctionInfo = NULL;
|
||||
m_FunctionInstructionIdx = 0;
|
||||
m_GlobalInstructionIdx = 0;
|
||||
m_ActiveGlobalInstructionIdx = 0;
|
||||
m_Killed = false;
|
||||
m_Ended = false;
|
||||
m_Callstack.clear();
|
||||
@@ -1747,7 +1747,7 @@ void ThreadState::EnterFunction(const Function *function, const rdcarray<Value *
|
||||
m_PreviousBlock = ~0U;
|
||||
m_PhiVariables.clear();
|
||||
|
||||
m_GlobalInstructionIdx = m_FunctionInfo->globalInstructionOffset + m_FunctionInstructionIdx;
|
||||
m_ActiveGlobalInstructionIdx = m_FunctionInfo->globalInstructionOffset + m_FunctionInstructionIdx;
|
||||
m_Callstack.push_back(frame);
|
||||
|
||||
ShaderDebugState *state = m_State;
|
||||
@@ -4144,14 +4144,13 @@ bool ThreadState::ExecuteInstruction(DebugAPIWrapper *apiWrapper,
|
||||
{
|
||||
m_Block = blockId;
|
||||
m_FunctionInstructionIdx = m_FunctionInfo->function->blocks[m_Block]->startInstructionIdx;
|
||||
m_GlobalInstructionIdx = m_FunctionInfo->globalInstructionOffset + m_FunctionInstructionIdx;
|
||||
}
|
||||
else
|
||||
{
|
||||
RDCERR("Unknown branch target %u '%s'", m_Block, GetArgumentName(targetArg).c_str());
|
||||
}
|
||||
if(m_State && !m_Ended)
|
||||
m_State->nextInstruction = m_GlobalInstructionIdx;
|
||||
m_State->nextInstruction = m_FunctionInfo->globalInstructionOffset + m_FunctionInstructionIdx;
|
||||
break;
|
||||
}
|
||||
case Operation::Phi:
|
||||
@@ -5228,7 +5227,6 @@ bool ThreadState::ExecuteInstruction(DebugAPIWrapper *apiWrapper,
|
||||
{
|
||||
m_Block = blockId;
|
||||
m_FunctionInstructionIdx = m_FunctionInfo->function->blocks[m_Block]->startInstructionIdx;
|
||||
m_GlobalInstructionIdx = m_FunctionInfo->globalInstructionOffset + m_FunctionInstructionIdx;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5458,12 +5456,12 @@ void ThreadState::StepOverNopInstructions()
|
||||
return;
|
||||
do
|
||||
{
|
||||
m_GlobalInstructionIdx = m_FunctionInfo->globalInstructionOffset + m_FunctionInstructionIdx;
|
||||
RDCASSERT(m_FunctionInstructionIdx < m_FunctionInfo->function->instructions.size());
|
||||
const Instruction *inst = m_FunctionInfo->function->instructions[m_FunctionInstructionIdx];
|
||||
if(!IsNopInstruction(*inst))
|
||||
{
|
||||
m_ActiveGlobalInstructionIdx = m_GlobalInstructionIdx;
|
||||
m_ActiveGlobalInstructionIdx =
|
||||
m_FunctionInfo->globalInstructionOffset + m_FunctionInstructionIdx;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5476,9 +5474,8 @@ void ThreadState::StepNext(ShaderDebugState *state, DebugAPIWrapper *apiWrapper,
|
||||
{
|
||||
m_State = state;
|
||||
|
||||
RDCASSERTEQUAL(m_GlobalInstructionIdx,
|
||||
RDCASSERTEQUAL(m_ActiveGlobalInstructionIdx,
|
||||
m_FunctionInfo->globalInstructionOffset + m_FunctionInstructionIdx);
|
||||
RDCASSERTEQUAL(m_ActiveGlobalInstructionIdx, m_GlobalInstructionIdx);
|
||||
if(m_State)
|
||||
{
|
||||
m_State->flags = ShaderEvents::NoEvent;
|
||||
@@ -8378,7 +8375,7 @@ rdcarray<ShaderDebugState> Debugger::ContinueDebug(DebugAPIWrapper *apiWrapper)
|
||||
{
|
||||
thread.EnterEntryPoint(m_EntryPointFunction, &initial);
|
||||
thread.FillCallstack(initial);
|
||||
initial.nextInstruction = thread.m_GlobalInstructionIdx;
|
||||
initial.nextInstruction = thread.m_ActiveGlobalInstructionIdx;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -326,9 +326,7 @@ struct ThreadState
|
||||
// The current and previous function basic block index
|
||||
uint32_t m_Block = ~0U;
|
||||
uint32_t m_PreviousBlock = ~0U;
|
||||
// A global logical instruction index (bit like a PC) not the instruction index within a function
|
||||
uint32_t m_GlobalInstructionIdx = ~0U;
|
||||
// The PC of the active instruction that was or will be executed on the current simulation step
|
||||
// The global PC of the active instruction that was or will be executed on the current simulation step
|
||||
uint32_t m_ActiveGlobalInstructionIdx = ~0U;
|
||||
|
||||
// SSA Ids guaranteed to be greater than 0 and less than this value
|
||||
|
||||
Reference in New Issue
Block a user