mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
DXIL Debugger use function name for callstack if no debug scopes
This commit is contained in:
@@ -1657,13 +1657,35 @@ void ThreadState::EnterEntryPoint(const Function *function, ShaderDebugState *st
|
||||
|
||||
void ThreadState::FillCallstack(ShaderDebugState &state)
|
||||
{
|
||||
if(m_FunctionInfo->callstacks.size() == 1)
|
||||
{
|
||||
state.callstack = m_FunctionInfo->callstacks.begin()->second;
|
||||
return;
|
||||
}
|
||||
|
||||
auto it = m_FunctionInfo->callstacks.upper_bound(state.nextInstruction);
|
||||
if(it == m_FunctionInfo->callstacks.end())
|
||||
{
|
||||
RDCWARN("No callstack entry found for instruction %u", state.nextInstruction);
|
||||
state.callstack.clear();
|
||||
state.callstack.push_back(m_FunctionInfo->function->name);
|
||||
return;
|
||||
}
|
||||
|
||||
if(it != m_FunctionInfo->callstacks.begin())
|
||||
--it;
|
||||
|
||||
if(it->first <= m_FunctionInstructionIdx)
|
||||
{
|
||||
state.callstack = it->second;
|
||||
}
|
||||
else
|
||||
{
|
||||
RDCWARN("No callstack entry found for instruction %u", state.nextInstruction);
|
||||
state.callstack.clear();
|
||||
state.callstack.push_back(m_FunctionInfo->function->name);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bool IsNopInstruction(const Instruction &inst)
|
||||
@@ -7529,6 +7551,13 @@ ShaderDebugTrace *Debugger::BeginDebug(uint32_t eventId, const DXBC::DXBCContain
|
||||
}
|
||||
info.callstacks[instructionIndex] = callstack;
|
||||
}
|
||||
// If there is no callstack for the function then use the function name
|
||||
if(info.callstacks.empty())
|
||||
{
|
||||
FunctionInfo::Callstack callstack;
|
||||
callstack.push_back(f->name);
|
||||
info.callstacks[0] = callstack;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user