Create separate OpSource for each included file

This commit is contained in:
Greg Fischer
2018-12-06 11:13:15 -07:00
parent 9ed38739b9
commit d445bb2867
6 changed files with 131 additions and 104 deletions

View File

@@ -1297,6 +1297,10 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl
text.append("#line 1\n");
text.append(glslangIntermediate->getSourceText());
builder.setSourceText(text);
// Pass name and text for all included files
const std::map<std::string, std::string>& include_txt = glslangIntermediate->getIncludeText();
for (auto iItr = include_txt.begin(); iItr != include_txt.end(); ++iItr)
builder.addInclude(iItr->first, iItr->second);
}
stdBuiltins = builder.import("GLSL.std.450");
if (glslangIntermediate->usingVulkanMemoryModel()) {