Merge pull request #3021 from qingyuanzNV/fix_opline_prepending_opfunction_with_pp

Fix OpLine prepending OpFunction reports wrong file when #line is pre…
This commit is contained in:
Greg Fischer
2022-09-21 16:49:46 -06:00
committed by GitHub
5 changed files with 154 additions and 97 deletions

View File

@@ -2865,7 +2865,9 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
}
if (options.generateDebugInfo) {
const auto& loc = node->getLoc();
currentFunction->setDebugLineInfo(builder.getSourceFile(), loc.line, loc.column);
const char* sourceFileName = loc.getFilename();
spv::Id sourceFileId = sourceFileName ? builder.getStringId(sourceFileName) : builder.getSourceFile();
currentFunction->setDebugLineInfo(sourceFileId, loc.line, loc.column);
}
} else {
if (inEntryPoint)