Skip to content

Commit ce895a1

Browse files
committed
Extend handling in GetFunctionScopeName()
Now supports passing in: DISubprogram DILexicalBlock In addition to existing support for: DILocalVariable DIGlobalVariable
1 parent 5703e32 commit ce895a1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

renderdoc/driver/shaders/dxil/dxil_debuginfo.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -415,11 +415,19 @@ rdcstr Program::GetDebugVarName(const DIBase *d) const
415415

416416
rdcstr Program::GetFunctionScopeName(const DIBase *d) const
417417
{
418+
if(d->type == DIBase::Subprogram)
419+
{
420+
const rdcstr *name = d->As<DISubprogram>()->name;
421+
return name ? *name : "";
422+
}
423+
418424
const Metadata *scope = NULL;
419425
if(d->type == DIBase::LocalVariable)
420426
scope = d->As<DILocalVariable>()->scope;
421-
if(d->type == DIBase::GlobalVariable)
427+
else if(d->type == DIBase::GlobalVariable)
422428
scope = d->As<DIGlobalVariable>()->scope;
429+
else if(d->type == DIBase::LexicalBlock)
430+
scope = d->As<DILexicalBlock>()->scope;
423431

424432
while(scope && scope->dwarf)
425433
{

0 commit comments

Comments
 (0)