DXIL Debugger find the entry point in GetLineInfo

Get entry point from meta data if the entry point is empty
This commit is contained in:
Jake Turner
2024-09-24 11:06:00 +01:00
parent 8b23157086
commit 11e8039622
3 changed files with 25 additions and 0 deletions
@@ -329,6 +329,12 @@ void MakeShaderReflection(DXBC::DXBCContainer *dxbc, const ShaderEntryPoint &ent
refl->debugInfo.files = dxbc->GetDebugInfo()->Files;
// For DXIL ensure the entry point meta data has been parsed
if(dxbc->GetDXILByteCode())
{
dxbc->GetDXILByteCode()->FetchEntryPoint();
}
dxbc->GetDebugInfo()->GetLineInfo(~0U, ~0U, refl->debugInfo.entryLocation);
rdcstr entryFunc = entry.name;
@@ -1559,6 +1559,7 @@ public:
const bytebuf &GetBytes() const { return m_Bytes; }
void FetchComputeProperties(DXBC::Reflection *reflection);
void FetchEntryPoint();
DXBC::Reflection *BuildReflection();
rdcstr GetDebugStatus();
rdcarray<ShaderEntryPoint> GetEntryPoints();
@@ -1461,6 +1461,24 @@ rdcarray<ShaderEntryPoint> Program::GetEntryPoints()
return ret;
}
void Program::FetchEntryPoint()
{
if(m_EntryPoint.empty())
{
DXMeta dx(m_NamedMeta);
if(dx.entryPoints && dx.entryPoints->children.size() > 0 &&
dx.entryPoints->children[0]->children.size() > 2)
{
m_EntryPoint = dx.entryPoints->children[0]->children[1]->str;
}
else
{
RDCERR("Didn't find dx.entryPoints");
m_EntryPoint = "main";
}
}
}
DXBC::Reflection *Program::BuildReflection()
{
const bool dxcStyleFormatting = m_DXCStyle;