mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-10 00:31:00 +00:00
Use existing Files entry for empty shader source file "unnamed_shader"
Fixes source shader stepping when the main shader source file contains #line entries with blank filenames ie.
This commit is contained in:
@@ -1467,9 +1467,25 @@ SPDBChunk::SPDBChunk(byte *data, uint32_t spdblength)
|
||||
// source according to #line
|
||||
if(!name.empty())
|
||||
{
|
||||
Files.push_back({name, ""});
|
||||
int32_t fileIdx = -1;
|
||||
if(name == "unnamed_shader")
|
||||
{
|
||||
for(int32_t i = 0; i < Files.count(); i++)
|
||||
{
|
||||
if(!_stricmp(Files[i].filename.c_str(), name.c_str()))
|
||||
{
|
||||
fileIdx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(fileIdx == -1)
|
||||
{
|
||||
Files.push_back({name, ""});
|
||||
fileIdx = (int32_t)Files.size() - 1;
|
||||
}
|
||||
|
||||
FileMapping[chunkOffs] = (int32_t)Files.size() - 1;
|
||||
FileMapping[chunkOffs] = fileIdx;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user