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:
John Kessenich 2013-02-06 23:06:52 +00:00
parent c435c71d87
commit 46eaf4939e
5 changed files with 79 additions and 64 deletions

View file

@ -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;