Support multiple default versions, to enable ES vs. desktop contexts, for shaders missing a #version statement.
This also moved some parseContext code from the flex file to the proper C++ file. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20501 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
c435c71d87
commit
46eaf4939e
5 changed files with 79 additions and 64 deletions
|
|
@ -190,7 +190,7 @@ bool InitializeSymbolTable(TBuiltInStrings* BuiltInStrings, EShLanguage language
|
|||
else
|
||||
symbolTable = &symbolTables[language];
|
||||
|
||||
TParseContext parseContext(*symbolTable, intermediate, language, infoSink);
|
||||
TParseContext parseContext(*symbolTable, intermediate, language, infoSink, 110);
|
||||
|
||||
GlobalParseContext = &parseContext;
|
||||
|
||||
|
|
@ -255,7 +255,8 @@ int ShCompile(
|
|||
const int numStrings,
|
||||
const EShOptimizationLevel optLevel,
|
||||
const TBuiltInResource* resources,
|
||||
int debugOptions
|
||||
int debugOptions,
|
||||
int defaultVersion
|
||||
)
|
||||
{
|
||||
if (!InitThread())
|
||||
|
|
@ -281,9 +282,7 @@ int ShCompile(
|
|||
|
||||
GenerateBuiltInSymbolTable(resources, compiler->infoSink, &symbolTable, compiler->getLanguage());
|
||||
|
||||
// TODO: this is happening *after* initialization, which already parsed some things... what parse context was that?
|
||||
// what extensions did it have?
|
||||
TParseContext parseContext(symbolTable, intermediate, compiler->getLanguage(), compiler->infoSink);
|
||||
TParseContext parseContext(symbolTable, intermediate, compiler->getLanguage(), compiler->infoSink, defaultVersion);
|
||||
parseContext.initializeExtensionBehavior();
|
||||
|
||||
GlobalParseContext = &parseContext;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue