Skip to content

Commit

Permalink
Keep source files with either blank name or contents in SPIR-V
Browse files Browse the repository at this point in the history
* Only filter out source files with no name and no contents.
  • Loading branch information
baldurk committed Mar 5, 2024
1 parent 47cef17 commit c1f775e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions renderdoc/driver/shaders/spirv/spirv_reflect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,10 +623,10 @@ void Reflector::RegisterOp(Iter it)

sourceLanguage = source.sourceLanguage;

rdcstr name = strings[source.file];
// don't add empty source statements as actual files
if(!source.source.empty())
if(!name.empty() || !source.source.empty())
{
rdcstr name = strings[source.file];
if(name.empty())
name = "unnamed_shader";

Expand Down Expand Up @@ -666,7 +666,7 @@ void Reflector::RegisterOp(Iter it)
rdcstr source = dbg.params.size() > 1 ? strings[dbg.arg<Id>(1)] : rdcstr();

// don't add empty source statements as actual files
if(!source.empty())
if(!name.empty() || !source.empty())
{
debugSources[dbg.result] = sources.size();
sources.push_back({name, source});
Expand Down

0 comments on commit c1f775e

Please sign in to comment.