Fix issue for new unique id system. Add level bits to help verifying symbols and split symbol tables.

For intermediates rebuilding, now need manually amending level bits for redeclaring built-ins.
This commit is contained in:
Chow 2020-11-12 15:54:16 +08:00
parent 74e8f05b9f
commit 93b400f267
17 changed files with 110 additions and 71 deletions

View file

@ -949,6 +949,9 @@ bool ProcessDeferred(
if (cachedTable)
symbolTable->adoptLevels(*cachedTable);
if (intermediate.getUniqueId() != 0)
symbolTable->overwriteUniqueId(intermediate.getUniqueId());
// Add built-in symbols that are potentially context dependent;
// they get popped again further down.
if (! AddContextSpecificSymbols(resources, compiler->infoSink, *symbolTable, version, profile, spvVersion,
@ -1011,6 +1014,7 @@ bool ProcessDeferred(
bool success = processingContext(*parseContext, ppContext, fullInput,
versionWillBeError, *symbolTable,
intermediate, optLevel, messages);
intermediate.setUniqueId(symbolTable->getMaxSymbolId());
return success;
}
@ -1810,6 +1814,11 @@ void TShader::addProcesses(const std::vector<std::string>& p)
intermediate->addProcesses(p);
}
void TShader::setUniqueId(unsigned long long id)
{
intermediate->setUniqueId(id);
}
void TShader::setInvertY(bool invert) { intermediate->setInvertY(invert); }
void TShader::setNanMinMaxClamp(bool useNonNan) { intermediate->setNanMinMaxClamp(useNonNan); }