Keep source files with either blank name or contents in SPIR-V

* Only filter out source files with no name and no contents.
This commit is contained in:
baldurk
2024-03-05 08:02:25 +00:00
parent 47cef17f5a
commit c1f775eb2e
@@ -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";
@@ -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});