SPV/Standalone: Support specifying arbitrary versions of SPIR-V.

This commit is contained in:
John Kessenich
2018-10-26 10:12:32 -06:00
parent ae63a8dfce
commit 8717a5d39a
4 changed files with 83 additions and 36 deletions

4
SPIRV/GlslangToSpv.cpp Normal file → Executable file
View File

@@ -1265,14 +1265,14 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl
std::string text;
const std::vector<std::string>& processes = glslangIntermediate->getProcesses();
for (int p = 0; p < (int)processes.size(); ++p) {
if (glslangIntermediate->getSpv().spv < 0x00010100) {
if (glslangIntermediate->getSpv().spv < glslang::EShTargetSpv_1_1) {
text.append("// OpModuleProcessed ");
text.append(processes[p]);
text.append("\n");
} else
builder.addModuleProcessed(processes[p]);
}
if (glslangIntermediate->getSpv().spv < 0x00010100 && (int)processes.size() > 0)
if (glslangIntermediate->getSpv().spv < glslang::EShTargetSpv_1_1 && (int)processes.size() > 0)
text.append("#line 1\n");
text.append(glslangIntermediate->getSourceText());
builder.setSourceText(text);