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

@ -67,7 +67,7 @@ struct TPragma {
// they can be passed to the parser without needing a global.
//
struct TParseContext {
TParseContext(TSymbolTable& symt, TIntermediate& interm, EShLanguage L, TInfoSink& is);
TParseContext(TSymbolTable& symt, TIntermediate& interm, EShLanguage L, TInfoSink& is, int defaultVersion);
TIntermediate& intermediate; // to hold and build a parse tree
TSymbolTable& symbolTable; // symbol table that goes with the language currently being parsed
TInfoSink& infoSink;
@ -92,6 +92,9 @@ struct TParseContext {
TString HashErrMsg;
bool AfterEOF;
void setVersion(int);
void setProfile(EProfile);
void initializeExtensionBehavior();
void C_DECL error(TSourceLoc, const char *szReason, const char *szToken,