diff --git a/Test/330.frag b/Test/330.frag index a3301a2c3b70fa50a2aab197b2816e130e1b15ef..57736b0c46dce808d47222f14a105bcc5136fcc4 100644 --- a/Test/330.frag +++ b/Test/330.frag @@ -140,3 +140,11 @@ void qlod() lod = textureQueryLod(samp1D, pf); // ERROR, not until 400 lod = textureQueryLod(samp2Ds, pf2); // ERROR, not until 400 } + +int precise; // okay, not a keyword yet +struct SKeyMem { int precise; } KeyMem; // okay, not a keyword yet + +void fooKeyMem() +{ + KeyMem.precise; +} diff --git a/Test/400.frag b/Test/400.frag index a2c4691abe06901dffa1b929d04bc1ccc045f5e0..bb4d2b58423b74fb64d6881ace16defd5820b61d 100644 --- a/Test/400.frag +++ b/Test/400.frag @@ -183,3 +183,5 @@ void qlod() lod = textureQueryLod(sampBuf, pf); // ERROR lod = textureQueryLod(sampRect, pf2); // ERROR } + +struct SKeyMem { int precise; } KeyMem; // ERROR, keyword can't be a member diff --git a/Test/baseResults/330.frag.out b/Test/baseResults/330.frag.out index 2def6c7b3cc4f435f34c27b5b289bcf58d0dee45..773a72c1833001a0e15a9be12f09da6f08b872d2 100644 --- a/Test/baseResults/330.frag.out +++ b/Test/baseResults/330.frag.out @@ -79,6 +79,13 @@ ERROR: node is still EOpNull! 0:? Sequence 0:140 'lod' (temp 2-component vector of float) 0:141 'lod' (temp 2-component vector of float) +0:147 Function Definition: fooKeyMem( (global void) +0:147 Function Parameters: +0:149 Sequence +0:149 precise: direct index for structure (global int) +0:149 'KeyMem' (global structure{global int precise}) +0:149 Constant: +0:149 0 (const int) 0:? Linker Objects 0:? 'inVar' (smooth in 4-component vector of float) 0:? 'outVar' (layout(location=0 index=0 ) out 4-component vector of float) @@ -113,6 +120,8 @@ ERROR: node is still EOpNull! 0:? 'indexBlockI' (layout(location=26 index=0 ) out block{out int a}) 0:? 'samp1D' (uniform sampler1D) 0:? 'samp2Ds' (uniform sampler2DShadow) +0:? 'precise' (global int) +0:? 'KeyMem' (global structure{global int precise}) Linked fragment stage: @@ -159,6 +168,13 @@ ERROR: node is still EOpNull! 0:? Sequence 0:140 'lod' (temp 2-component vector of float) 0:141 'lod' (temp 2-component vector of float) +0:147 Function Definition: fooKeyMem( (global void) +0:147 Function Parameters: +0:149 Sequence +0:149 precise: direct index for structure (global int) +0:149 'KeyMem' (global structure{global int precise}) +0:149 Constant: +0:149 0 (const int) 0:? Linker Objects 0:? 'inVar' (smooth in 4-component vector of float) 0:? 'outVar' (layout(location=0 index=0 ) out 4-component vector of float) @@ -193,4 +209,6 @@ ERROR: node is still EOpNull! 0:? 'indexBlockI' (layout(location=26 index=0 ) out block{out int a}) 0:? 'samp1D' (uniform sampler1D) 0:? 'samp2Ds' (uniform sampler2DShadow) +0:? 'precise' (global int) +0:? 'KeyMem' (global structure{global int precise}) diff --git a/Test/baseResults/400.frag.out b/Test/baseResults/400.frag.out index 7e09e8afd9527e0c0bb1b453a8f82bcc58289d6b..b620b144c49d78d9a831ae098d6e7eb6e7e29183 100644 --- a/Test/baseResults/400.frag.out +++ b/Test/baseResults/400.frag.out @@ -34,7 +34,8 @@ ERROR: 0:183: 'textureQueryLod' : no matching overloaded function found ERROR: 0:183: 'assign' : cannot convert from 'const float' to 'temp 2-component vector of float' ERROR: 0:184: 'textureQueryLod' : no matching overloaded function found ERROR: 0:184: 'assign' : cannot convert from 'const float' to 'temp 2-component vector of float' -ERROR: 34 compilation errors. No code generated. +ERROR: 0:187: '' : syntax error +ERROR: 35 compilation errors. No code generated. Shader version: 400 diff --git a/glslang/Include/revision.h b/glslang/Include/revision.h index 414cf210c5d4e82512b93fc470b35cd4e0f12bcf..e74c41ab39d231a38459df787ad8a58a9a5f0a61 100644 --- a/glslang/Include/revision.h +++ b/glslang/Include/revision.h @@ -2,5 +2,5 @@ // For the version, it uses the latest git tag followed by the number of commits. // For the date, it uses the current date (when then script is run). -#define GLSLANG_REVISION "3.0.777" -#define GLSLANG_DATE "01-Oct-2015" +#define GLSLANG_REVISION "3.0.778" +#define GLSLANG_DATE "02-Oct-2015" diff --git a/glslang/MachineIndependent/Scan.cpp b/glslang/MachineIndependent/Scan.cpp index 325a9a99d40132728b40e5d6f18b165070de151a..23e5191fad030c240ea6941c6e82f9f5a4aac331 100644 --- a/glslang/MachineIndependent/Scan.cpp +++ b/glslang/MachineIndependent/Scan.cpp @@ -598,7 +598,12 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token) case PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT; case PpAtomConstFloat: parserToken->sType.lex.d = ppToken.dval; return FLOATCONSTANT; case PpAtomConstDouble: parserToken->sType.lex.d = ppToken.dval; return DOUBLECONSTANT; - case PpAtomIdentifier: return tokenizeIdentifier(); + case PpAtomIdentifier: + { + int token = tokenizeIdentifier(); + field = false; + return token; + } case EndOfInput: return 0; @@ -623,7 +628,6 @@ int TScanContext::tokenizeIdentifier() return identifierOrType(); } keyword = it->second; - field = false; switch (keyword) { case CONST: @@ -1020,11 +1024,8 @@ int TScanContext::tokenizeIdentifier() int TScanContext::identifierOrType() { parserToken->sType.lex.string = NewPoolTString(tokenText); - if (field) { - field = false; - - return FIELD_SELECTION; - } + if (field) + return IDENTIFIER; parserToken->sType.lex.symbol = parseContext.symbolTable.find(*parserToken->sType.lex.string); if (afterType == false && parserToken->sType.lex.symbol) { diff --git a/glslang/MachineIndependent/glslang.y b/glslang/MachineIndependent/glslang.y index e7eb32027b8417b3ddcf7e2f207b717dbcf35897..0e0fca2502670126c055d564475ffbc79eeb9163 100644 --- a/glslang/MachineIndependent/glslang.y +++ b/glslang/MachineIndependent/glslang.y @@ -162,7 +162,6 @@ extern int yylex(YYSTYPE*, TParseContext&); %token <lex> IDENTIFIER TYPE_NAME %token <lex> FLOATCONSTANT DOUBLECONSTANT INTCONSTANT UINTCONSTANT BOOLCONSTANT -%token <lex> FIELD_SELECTION %token <lex> LEFT_OP RIGHT_OP %token <lex> INC_OP DEC_OP LE_OP GE_OP EQ_OP NE_OP %token <lex> AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN @@ -266,7 +265,7 @@ postfix_expression | function_call { $$ = $1; } - | postfix_expression DOT FIELD_SELECTION { + | postfix_expression DOT IDENTIFIER { $$ = parseContext.handleDotDereference($3.loc, $1, *$3.string); } | postfix_expression INC_OP {