mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-04 05:41:06 +00:00
Move demangling function to utility helper in DXBC
This commit is contained in:
@@ -412,4 +412,7 @@ public:
|
||||
virtual void GetLocals(const DXBC::DXBCContainer *dxbc, size_t instruction, uintptr_t offset,
|
||||
rdcarray<SourceVariableMapping> &locals) const = 0;
|
||||
};
|
||||
|
||||
rdcstr BasicDemangle(rdcstr possiblyMangledName);
|
||||
|
||||
};
|
||||
|
||||
@@ -42,6 +42,19 @@ RDOC_EXTERN_CONFIG(rdcarray<rdcstr>, DXBC_Debug_SearchDirPaths);
|
||||
|
||||
namespace DXBC
|
||||
{
|
||||
rdcstr BasicDemangle(rdcstr possiblyMangledName)
|
||||
{
|
||||
if(possiblyMangledName.size() > 2 && possiblyMangledName[0] == '\x1' &&
|
||||
possiblyMangledName[1] == '?')
|
||||
{
|
||||
int idx = possiblyMangledName.indexOf('@');
|
||||
if(idx > 2)
|
||||
return possiblyMangledName.substr(2, idx - 2);
|
||||
}
|
||||
|
||||
return possiblyMangledName;
|
||||
}
|
||||
|
||||
struct RDEFCBufferVariable
|
||||
{
|
||||
uint32_t nameOffset;
|
||||
|
||||
@@ -340,13 +340,7 @@ void MakeShaderReflection(DXBC::DXBCContainer *dxbc, const ShaderEntryPoint &ent
|
||||
refl->debugInfo.entrySourceName = refl->entryPoint = entryFunc;
|
||||
|
||||
// demangle DXIL source names for display
|
||||
if(refl->debugInfo.entrySourceName.size() > 2 && refl->debugInfo.entrySourceName[0] == '\x1' &&
|
||||
refl->debugInfo.entrySourceName[1] == '?')
|
||||
{
|
||||
int idx = refl->debugInfo.entrySourceName.indexOf('@');
|
||||
if(idx > 2)
|
||||
refl->debugInfo.entrySourceName = refl->debugInfo.entrySourceName.substr(2, idx - 2);
|
||||
}
|
||||
refl->debugInfo.entrySourceName = DXBC::BasicDemangle(refl->entryPoint);
|
||||
|
||||
// assume the debug info put the file with the entry point at the start. SDBG seems to do this
|
||||
// by default, and SPDB has an extra sorting step that probably maybe possibly does this.
|
||||
|
||||
Reference in New Issue
Block a user