mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 04:50:35 +00:00
Give empty sources 'unnamed_shader' name after checking for empty name
* This means that truly empty sources with no name or source are still properly filtered out - which is how OpSource works. Sources that are empty but have a name (e.g. ones referenced by #line directives) will still be kept, and unnamed sources with contents will be kept and given the unnamed filename.
This commit is contained in:
@@ -661,13 +661,14 @@ void Reflector::RegisterOp(Iter it)
|
||||
if(dbg.inst == ShaderDbg::Source)
|
||||
{
|
||||
rdcstr name = strings[dbg.arg<Id>(0)];
|
||||
if(name.empty())
|
||||
name = "unnamed_shader";
|
||||
rdcstr source = dbg.params.size() > 1 ? strings[dbg.arg<Id>(1)] : rdcstr();
|
||||
|
||||
// don't add empty source statements as actual files
|
||||
if(!name.empty() || !source.empty())
|
||||
{
|
||||
if(name.empty())
|
||||
name = "unnamed_shader";
|
||||
|
||||
debugSources[dbg.result] = sources.size();
|
||||
sources.push_back({name, source});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user