diff --git a/renderdoc/driver/shaders/dxil/dxil_debuginfo.cpp b/renderdoc/driver/shaders/dxil/dxil_debuginfo.cpp index b16b2bdbe..468d10f4c 100644 --- a/renderdoc/driver/shaders/dxil/dxil_debuginfo.cpp +++ b/renderdoc/driver/shaders/dxil/dxil_debuginfo.cpp @@ -415,11 +415,19 @@ rdcstr Program::GetDebugVarName(const DIBase *d) const rdcstr Program::GetFunctionScopeName(const DIBase *d) const { + if(d->type == DIBase::Subprogram) + { + const rdcstr *name = d->As()->name; + return name ? *name : ""; + } + const Metadata *scope = NULL; if(d->type == DIBase::LocalVariable) scope = d->As()->scope; - if(d->type == DIBase::GlobalVariable) + else if(d->type == DIBase::GlobalVariable) scope = d->As()->scope; + else if(d->type == DIBase::LexicalBlock) + scope = d->As()->scope; while(scope && scope->dwarf) {