Commit c2ff7702 by John Kessenich

For all keywords already present, get correct when they could be identifiers,…

For all keywords already present, get correct when they could be identifiers, are reserved words, or are keywords, for all versions of ESSL and GLSL. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21282 e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent 09da79e1
...@@ -63,4 +63,15 @@ void main() ...@@ -63,4 +63,15 @@ void main()
f |= b; // ERROR f |= b; // ERROR
gl_FragColor = texture2D(s2D, centTexCoord); gl_FragColor = texture2D(s2D, centTexCoord);
float flat;
float smooth;
float noperspective;
float uvec2;
float uvec3;
float uvec4;
//packed; // ERROR, reserved word
} }
float imageBuffer;
float uimage2DRect;
...@@ -9,6 +9,10 @@ precision highp float; ...@@ -9,6 +9,10 @@ precision highp float;
in vec4 i; in vec4 i;
out vec4 o; out vec4 o;
in flat float fflat;
in smooth float fsmooth;
in noperspective float fnop;
void main() void main()
{ {
} }
...@@ -21,14 +21,15 @@ uniform usampler2DArray us2DArray; ...@@ -21,14 +21,15 @@ uniform usampler2DArray us2DArray;
in float c1D; in float c1D;
in vec2 c2D; in vec2 c2D;
in vec3 c3D; in vec3 c3D;
in vec4 c4D; smooth vec4 c4D;
flat in int ic1D; flat in int ic1D;
flat in ivec2 ic2D; flat in ivec2 ic2D;
flat in ivec3 ic3D; flat in ivec3 ic3D;
flat in ivec4 ic4D; flat in ivec4 ic4D;
noperspective in vec4 badv; // ERROR
in sampler2D bads; // ERROR in sampler2D bads; // ERROR
precision lowp uint; // ERROR
struct s { struct s {
int i; int i;
...@@ -64,4 +65,13 @@ void main() ...@@ -64,4 +65,13 @@ void main()
iv = texelFetch(is2DArray, ic3D, ic1D); iv = texelFetch(is2DArray, ic3D, ic1D);
iv.xy = textureSize(sCubeShadow, 2); iv.xy = textureSize(sCubeShadow, 2);
float precise;
double boo; // ERROR
dvec2 boo2; // ERROR
dvec3 boo3; // ERROR
dvec4 boo4; // ERROR
} }
float imageBuffer; // ERROR, reserved
float uimage2DRect; // ERROR, reserved
...@@ -5,7 +5,7 @@ uniform mat3x3 m33; ...@@ -5,7 +5,7 @@ uniform mat3x3 m33;
uniform mat4x4 m44; uniform mat4x4 m44;
in vec3 v3; in vec3 v3;
in vec2 v2; varying vec2 v2; // ERROR
in vec4 bad[10]; // ERROR in vec4 bad[10]; // ERROR
......
...@@ -43,3 +43,7 @@ void main() ...@@ -43,3 +43,7 @@ void main()
pos = p * (tblock.M1 + tblock.M2 + M4 + M3 + t2m); pos = p * (tblock.M1 + tblock.M2 + M4 + M3 + t2m);
color = c * tblock.N1; color = c * tblock.N1;
} }
shared vec4 compute_only; // ERROR
layout(packed) uniform;
...@@ -9,4 +9,5 @@ void main() ...@@ -9,4 +9,5 @@ void main()
{ {
gl_FragColor = varyingVar; gl_FragColor = varyingVar;
gl_FragData[1] = inVar; gl_FragData[1] = inVar;
int buffer = 4;
} }
...@@ -13,7 +13,7 @@ int global_medium; ...@@ -13,7 +13,7 @@ int global_medium;
precision highp int; precision highp int;
precision highp ivec2; // ERROR precision highp ivec2; // ERROR
precision mediump int[2]; // ERROR precision mediump int[2]; // ERROR
precision lowp uint; // ERROR vec4 uint; // okay
precision mediump vec4; // ERROR precision mediump vec4; // ERROR
int global_high; int global_high;
......
...@@ -23,7 +23,7 @@ int k = 0x80000000; // k gets -2147483648 == 0x80000000 ...@@ -23,7 +23,7 @@ int k = 0x80000000; // k gets -2147483648 == 0x80000000
int l = 2147483648; // l gets -2147483648 (the literal set the sign bit) int l = 2147483648; // l gets -2147483648 (the literal set the sign bit)
float fa, fb = 1.5; // single-precision floating-point float fa, fb = 1.5; // single-precision floating-point
//double fc, fd = 2.0LF; // double-precision floating-point double fc, fd = 2.0LF; // double-precision floating-point
vec2 texcoord1, texcoord2; vec2 texcoord1, texcoord2;
vec3 position; vec3 position;
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
in vec3 color; in vec3 color;
out vec4 foo; out vec4 foo;
uniform sampler2DRect bar; uniform sampler2DArrayShadow bar;
void main() void main()
{ {
......
...@@ -562,7 +562,8 @@ void TBuiltIns::initialize(int version, EProfile profile) ...@@ -562,7 +562,8 @@ void TBuiltIns::initialize(int version, EProfile profile)
// Original-style texture Functions existing in both stages. // Original-style texture Functions existing in both stages.
// (Per-stage functions below.) // (Per-stage functions below.)
// //
if (profile != EEsProfile || version == 100) { if (profile == EEsProfile && version == 100 ||
profile == ECompatibilityProfile || version < FirstProfileVersion) {
s.append(TString("vec4 texture2D(sampler2D, vec2);")); s.append(TString("vec4 texture2D(sampler2D, vec2);"));
s.append(TString("vec4 texture2DProj(sampler2D, vec3);")); s.append(TString("vec4 texture2DProj(sampler2D, vec3);"));
...@@ -571,7 +572,8 @@ void TBuiltIns::initialize(int version, EProfile profile) ...@@ -571,7 +572,8 @@ void TBuiltIns::initialize(int version, EProfile profile)
s.append(TString("vec4 textureCube(samplerCube, vec3);")); s.append(TString("vec4 textureCube(samplerCube, vec3);"));
} }
if (profile != EEsProfile && version > 100) { if (profile != EEsProfile &&
(profile == ECompatibilityProfile || version < FirstProfileVersion)) {
s.append(TString("vec4 texture1D(sampler1D, float);")); s.append(TString("vec4 texture1D(sampler1D, float);"));
s.append(TString("vec4 texture1DProj(sampler1D, vec2);")); s.append(TString("vec4 texture1DProj(sampler1D, vec2);"));
...@@ -585,12 +587,7 @@ void TBuiltIns::initialize(int version, EProfile profile) ...@@ -585,12 +587,7 @@ void TBuiltIns::initialize(int version, EProfile profile)
s.append(TString("vec4 shadow1DProj(sampler1DShadow, vec4);")); s.append(TString("vec4 shadow1DProj(sampler1DShadow, vec4);"));
s.append(TString("vec4 shadow2DProj(sampler2DShadow, vec4);")); s.append(TString("vec4 shadow2DProj(sampler2DShadow, vec4);"));
// ARB_texture_rectangle // TODO: functionality: non-ES legacy texuring for Lod, others?
s.append(TString("vec4 texture2DRect(sampler2DRect, vec2);"));
s.append(TString("vec4 texture2DRectProj(sampler2DRect, vec3);"));
s.append(TString("vec4 texture2DRectProj(sampler2DRect, vec4);"));
s.append(TString("vec4 shadow2DRect(sampler2DRectShadow, vec3);"));
s.append(TString("vec4 shadow2DRectProj(sampler2DRectShadow, vec4);"));
} }
s.append(TString("\n")); s.append(TString("\n"));
...@@ -988,6 +985,8 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile) ...@@ -988,6 +985,8 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile)
if ((dim == Esd1D || dim == EsdRect) && profile == EEsProfile) if ((dim == Esd1D || dim == EsdRect) && profile == EEsProfile)
continue; continue;
if (dim == EsdRect && version < 140)
continue;
if (dim != Esd2D && ms) if (dim != Esd2D && ms)
continue; continue;
if ((dim == Esd3D || dim == EsdRect) && arrayed) if ((dim == Esd3D || dim == EsdRect) && arrayed)
......
...@@ -66,13 +66,17 @@ LF [lL][fF] ...@@ -66,13 +66,17 @@ LF [lL][fF]
#include "ParseHelper.h" #include "ParseHelper.h"
#include "glslang_tab.cpp.h" #include "glslang_tab.cpp.h"
int PaReservedWord(); void PaReservedWord();
int PaIdentOrType(TString& id, TParseContext&, TSymbol*&); void PaCompatibilityWord(TParseContext&);
int PaIdentOrType(const char* yytext, TParseContext&, YYSTYPE* pyylval);
int PaIdentOrReserved(bool reserved, TParseContext&, int line, const char* text, YYSTYPE* pyylval); int PaIdentOrReserved(bool reserved, TParseContext&, int line, const char* text, YYSTYPE* pyylval);
int PaES30ReservedFromGLSL(int version, TParseContext& pc, int line, const char* text, YYSTYPE* pyylval, int keyword); int PaES30ReservedFromGLSL(int version, TParseContext& pc, int line, const char* text, YYSTYPE* pyylval, int keyword);
int PaNonreservedKeyword(int esVersion, int nonEsVersion, TParseContext& pc, int line, const char* text, YYSTYPE* pyylval, int keyword);
int PaPrecisionKeyword(TParseContext&, int line, const char* text, YYSTYPE* pyylval, int keyword); int PaPrecisionKeyword(TParseContext&, int line, const char* text, YYSTYPE* pyylval, int keyword);
int PaMatNxM(TParseContext&, int line, const char* text, YYSTYPE* pyylval, int keyword); int PaMatNxM(TParseContext&, int line, const char* text, YYSTYPE* pyylval, int keyword);
int PaDMat(TParseContext&, int line, const char* text, YYSTYPE* pyylval, int keyword); int PaDMat(TParseContext&, int line, const char* text, YYSTYPE* pyylval, int keyword);
int Pa1stGenerationImage(TParseContext&, int line, const char* text, YYSTYPE* pyylval, int keyword);
int Pa2ndGenerationImage(TParseContext&, int line, const char* text, YYSTYPE* pyylval, int keyword);
/* windows only pragma */ /* windows only pragma */
#ifdef _MSC_VER #ifdef _MSC_VER
...@@ -100,80 +104,134 @@ int yy_input(char* buf, int max_size); ...@@ -100,80 +104,134 @@ int yy_input(char* buf, int max_size);
%option outfile="gen_glslang.cpp" %option outfile="gen_glslang.cpp"
%x FIELDS %x FIELDS
%% %%
<*>"//"[^\n]*"\n" { /* CPP should have taken care of this */ }; <*>"//"[^\n]*"\n" { /* CPP should have taken care of this */ };
"attribute" { pyylval->lex.line = yylineno; return(ATTRIBUTE); } // TODO: semantics: ES 30 reserved "attribute" { pyylval->lex.line = yylineno;
"const" { pyylval->lex.line = yylineno; return(CONST); } if (parseContext.profile == EEsProfile && parseContext.version >= 300)
"uniform" { pyylval->lex.line = yylineno; return(UNIFORM); } PaReservedWord();
"varying" { pyylval->lex.line = yylineno; return(VARYING); } // TODO: semantics: ES 30 reserved PaCompatibilityWord(parseContext);
"buffer" { pyylval->lex.line = yylineno; return(BUFFER); } return ATTRIBUTE;
"shared" { pyylval->lex.line = yylineno; return(SHARED); } }
"const" { pyylval->lex.line = yylineno;
return CONST;
}
"uniform" { pyylval->lex.line = yylineno;
return UNIFORM;
}
"varying" { pyylval->lex.line = yylineno;
if (parseContext.profile == EEsProfile && parseContext.version >= 300)
PaReservedWord();
PaCompatibilityWord(parseContext);
return VARYING;
}
"buffer" { pyylval->lex.line = yylineno;
if (parseContext.version < 430)
return PaIdentOrType(yytext, parseContext, pyylval);
return BUFFER;
}
"shared" { pyylval->lex.line = yylineno;
if (parseContext.profile == EEsProfile && parseContext.version < 300 ||
parseContext.profile != EEsProfile && parseContext.version < 140)
return PaIdentOrType(yytext, parseContext, pyylval);
return SHARED;
}
"coherent" { return PaES30ReservedFromGLSL(420, parseContext, yylineno, yytext, pyylval, COHERENT); } "coherent" { return PaES30ReservedFromGLSL(420, parseContext, yylineno, yytext, pyylval, COHERENT); }
"volatile" { if (parseContext.profile == EEsProfile || parseContext.version < 420) "volatile" { pyylval->lex.line = yylineno;
return PaReservedWord(); if (parseContext.profile == EEsProfile || parseContext.version < 420)
else PaReservedWord();
pyylval->lex.line = yylineno; return(VOLATILE); return VOLATILE;
} }
"restrict" { return PaES30ReservedFromGLSL(420, parseContext, yylineno, yytext, pyylval, RESTRICT); } "restrict" { return PaES30ReservedFromGLSL(420, parseContext, yylineno, yytext, pyylval, RESTRICT); }
"readonly" { return PaES30ReservedFromGLSL(420, parseContext, yylineno, yytext, pyylval, READONLY); } "readonly" { return PaES30ReservedFromGLSL(420, parseContext, yylineno, yytext, pyylval, READONLY); }
"writeonly" { return PaES30ReservedFromGLSL(420, parseContext, yylineno, yytext, pyylval, WRITEONLY); } "writeonly" { return PaES30ReservedFromGLSL(420, parseContext, yylineno, yytext, pyylval, WRITEONLY); }
"layout" { pyylval->lex.line = yylineno; return(LAYOUT); } "layout" { pyylval->lex.line = yylineno;
if (parseContext.profile == EEsProfile && parseContext.version < 300 ||
"centroid" { pyylval->lex.line = yylineno; return(CENTROID); } parseContext.profile != EEsProfile && parseContext.version < 140)
"flat" { pyylval->lex.line = yylineno; return(FLAT); } return PaIdentOrType(yytext, parseContext, pyylval);
"smooth" { pyylval->lex.line = yylineno; return(SMOOTH); } return LAYOUT;
"noperspective" { pyylval->lex.line = yylineno; return(NOPERSPECTIVE); } }
"centroid" { pyylval->lex.line = yylineno;
if (parseContext.version < 120)
return PaIdentOrType(yytext, parseContext, pyylval);
return CENTROID;
}
"flat" { pyylval->lex.line = yylineno;
if (parseContext.profile == EEsProfile && parseContext.version < 300)
PaReservedWord();
else if (parseContext.profile != EEsProfile && parseContext.version < 130)
return PaIdentOrType(yytext, parseContext, pyylval);
return FLAT;
}
"smooth" { pyylval->lex.line = yylineno;
if (parseContext.profile == EEsProfile && parseContext.version < 300 ||
parseContext.profile != EEsProfile && parseContext.version < 130)
return PaIdentOrType(yytext, parseContext, pyylval);
return SMOOTH;
}
"noperspective" { return PaES30ReservedFromGLSL(130, parseContext, yylineno, yytext, pyylval, NOPERSPECTIVE); }
"patch" { return PaES30ReservedFromGLSL(400, parseContext, yylineno, yytext, pyylval, PATCH); } "patch" { return PaES30ReservedFromGLSL(400, parseContext, yylineno, yytext, pyylval, PATCH); }
"sample" { return PaES30ReservedFromGLSL(400, parseContext, yylineno, yytext, pyylval, SAMPLE); } "sample" { return PaES30ReservedFromGLSL(400, parseContext, yylineno, yytext, pyylval, SAMPLE); }
"break" { pyylval->lex.line = yylineno; return(BREAK); } "break" { pyylval->lex.line = yylineno; return BREAK; }
"continue" { pyylval->lex.line = yylineno; return(CONTINUE); } "continue" { pyylval->lex.line = yylineno; return CONTINUE; }
"do" { pyylval->lex.line = yylineno; return(DO); } "do" { pyylval->lex.line = yylineno; return DO; }
"for" { pyylval->lex.line = yylineno; return(FOR); } "for" { pyylval->lex.line = yylineno; return FOR; }
"while" { pyylval->lex.line = yylineno; return(WHILE); } "while" { pyylval->lex.line = yylineno; return WHILE; }
"switch" { pyylval->lex.line = yylineno; return(SWITCH); } "switch" { pyylval->lex.line = yylineno; return SWITCH; }
"case" { pyylval->lex.line = yylineno; return(CASE); } "case" { pyylval->lex.line = yylineno; return CASE; }
"default" { pyylval->lex.line = yylineno; return(DEFAULT); } "default" { pyylval->lex.line = yylineno; return DEFAULT; }
"if" { pyylval->lex.line = yylineno; return(IF); } "if" { pyylval->lex.line = yylineno; return IF; }
"else" { pyylval->lex.line = yylineno; return(ELSE); } "else" { pyylval->lex.line = yylineno; return ELSE; }
"subroutine" { return PaES30ReservedFromGLSL(400, parseContext, yylineno, yytext, pyylval, SUBROUTINE); } "subroutine" { return PaES30ReservedFromGLSL(400, parseContext, yylineno, yytext, pyylval, SUBROUTINE); }
"in" { pyylval->lex.line = yylineno; return(IN); } "in" { pyylval->lex.line = yylineno; return IN; }
"out" { pyylval->lex.line = yylineno; return(OUT); } "out" { pyylval->lex.line = yylineno; return OUT; }
"inout" { pyylval->lex.line = yylineno; return(INOUT); } "inout" { pyylval->lex.line = yylineno; return INOUT; }
"precise" { pyylval->lex.line = yylineno; return(PRECISE); } "precise" { pyylval->lex.line = yylineno;
"invariant" { pyylval->lex.line = yylineno; return(INVARIANT); } if (parseContext.profile == EEsProfile ||
parseContext.profile != EEsProfile && parseContext.version < 400)
return PaIdentOrType(yytext, parseContext, pyylval);
return PRECISE;
}
"invariant" { pyylval->lex.line = yylineno;;
if (parseContext.profile != EEsProfile && parseContext.version < 120)
return PaIdentOrType(yytext, parseContext, pyylval);
return INVARIANT;
}
"highp" { return PaPrecisionKeyword(parseContext, yylineno, yytext, pyylval, HIGH_PRECISION); } "highp" { return PaPrecisionKeyword(parseContext, yylineno, yytext, pyylval, HIGH_PRECISION); }
"mediump" { return PaPrecisionKeyword(parseContext, yylineno, yytext, pyylval, MEDIUM_PRECISION); } "mediump" { return PaPrecisionKeyword(parseContext, yylineno, yytext, pyylval, MEDIUM_PRECISION); }
"lowp" { return PaPrecisionKeyword(parseContext, yylineno, yytext, pyylval, LOW_PRECISION); } "lowp" { return PaPrecisionKeyword(parseContext, yylineno, yytext, pyylval, LOW_PRECISION); }
"precision" { return PaPrecisionKeyword(parseContext, yylineno, yytext, pyylval, PRECISION); } "precision" { return PaPrecisionKeyword(parseContext, yylineno, yytext, pyylval, PRECISION); }
"float" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(FLOAT); } "float" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return FLOAT; }
"double" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(DOUBLE); } "double" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
"int" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(INT); } if (parseContext.profile == EEsProfile || parseContext.version < 400)
"uint" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(UINT); } PaReservedWord();
"void" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(VOID); } return DOUBLE;
"bool" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(BOOL); } }
"true" { pyylval->lex.line = yylineno; pyylval->lex.b = true; return(BOOLCONSTANT); } "int" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return INT; }
"false" { pyylval->lex.line = yylineno; pyylval->lex.b = false; return(BOOLCONSTANT); } "uint" { parseContext.lexAfterType = true;
return PaNonreservedKeyword(300, 130, parseContext, yylineno, yytext, pyylval, UINT);
}
"void" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return VOID; }
"bool" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return BOOL; }
"true" { pyylval->lex.line = yylineno; pyylval->lex.b = true; return BOOLCONSTANT; }
"false" { pyylval->lex.line = yylineno; pyylval->lex.b = false; return BOOLCONSTANT; }
"discard" { pyylval->lex.line = yylineno; return(DISCARD); } "discard" { pyylval->lex.line = yylineno; return DISCARD; }
"return" { pyylval->lex.line = yylineno; return(RETURN); } "return" { pyylval->lex.line = yylineno; return RETURN; }
"atomic_uint" { return PaES30ReservedFromGLSL(420, parseContext, yylineno, yytext, pyylval, ATOMIC_UINT); } "atomic_uint" { return PaES30ReservedFromGLSL(420, parseContext, yylineno, yytext, pyylval, ATOMIC_UINT); }
"mat2" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(MAT2); } "mat2" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return MAT2; }
"mat3" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(MAT3); } "mat3" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return MAT3; }
"mat4" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(MAT4); } "mat4" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return MAT4; }
"mat2x2" { return PaMatNxM(parseContext, yylineno, yytext, pyylval, MAT2X2); } "mat2x2" { return PaMatNxM(parseContext, yylineno, yytext, pyylval, MAT2X2); }
"mat2x3" { return PaMatNxM(parseContext, yylineno, yytext, pyylval, MAT2X3); } "mat2x3" { return PaMatNxM(parseContext, yylineno, yytext, pyylval, MAT2X3); }
...@@ -197,116 +255,241 @@ int yy_input(char* buf, int max_size); ...@@ -197,116 +255,241 @@ int yy_input(char* buf, int max_size);
"dmat4x3" { return PaDMat(parseContext, yylineno, yytext, pyylval, DMAT4X3); } "dmat4x3" { return PaDMat(parseContext, yylineno, yytext, pyylval, DMAT4X3); }
"dmat4x4" { return PaDMat(parseContext, yylineno, yytext, pyylval, DMAT4X4); } "dmat4x4" { return PaDMat(parseContext, yylineno, yytext, pyylval, DMAT4X4); }
"vec2" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (VEC2); } "vec2" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return VEC2; }
"vec3" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (VEC3); } "vec3" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return VEC3; }
"vec4" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (VEC4); } "vec4" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return VEC4; }
"dvec2" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (DVEC2); } "dvec2" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
"dvec3" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (DVEC3); } if (parseContext.profile == EEsProfile || parseContext.version < 400)
"dvec4" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (DVEC4); } PaReservedWord();
"ivec2" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (IVEC2); } return DVEC2;
"ivec3" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (IVEC3); } }
"ivec4" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (IVEC4); } "dvec3" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
"uvec2" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (UVEC2); } if (parseContext.profile == EEsProfile || parseContext.version < 400)
"uvec3" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (UVEC3); } PaReservedWord();
"uvec4" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (UVEC4); } return DVEC3;
"bvec2" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (BVEC2); } }
"bvec3" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (BVEC3); } "dvec4" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
"bvec4" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (BVEC4); } if (parseContext.profile == EEsProfile || parseContext.version < 400)
PaReservedWord();
"sampler1D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER1D; } return DVEC4;
}
"ivec2" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return IVEC2; }
"ivec3" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return IVEC3; }
"ivec4" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return IVEC4; }
"uvec2" { parseContext.lexAfterType = true;
return PaNonreservedKeyword(300, 130, parseContext, yylineno, yytext, pyylval, UVEC2);
}
"uvec3" { parseContext.lexAfterType = true;
return PaNonreservedKeyword(300, 130, parseContext, yylineno, yytext, pyylval, UVEC3);
}
"uvec4" { parseContext.lexAfterType = true;
return PaNonreservedKeyword(300, 130, parseContext, yylineno, yytext, pyylval, UVEC4);
}
"bvec2" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return BVEC2; }
"bvec3" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return BVEC3; }
"bvec4" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return BVEC4; }
"sampler2D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER2D; } "sampler2D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER2D; }
"sampler3D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER3D; }
"samplerCube" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLERCUBE; } "samplerCube" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLERCUBE; }
"sampler1DShadow" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER1DSHADOW; }
"sampler2DShadow" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER2DSHADOW; }
"sampler2DRect" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER2DRECT; }
"isampler2DRect" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return ISAMPLER2DRECT; }
"usampler2DRect" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return USAMPLER2DRECT; }
"sampler2DRectShadow" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER2DRECTSHADOW; }
"samplerCubeShadow" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLERCUBESHADOW; }
"sampler1DArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER1DARRAY; }
"sampler2DArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER2DARRAY; }
"samplerCubeArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLERCUBEARRAY; }
"sampler1DArrayShadow" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER1DARRAYSHADOW; }
"sampler2DArrayShadow" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER2DARRAYSHADOW; }
"samplerCubeArrayShadow" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLERCUBEARRAYSHADOW; }
"isampler1D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return ISAMPLER1D; }
"isampler2D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return ISAMPLER2D; }
"isampler3D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return ISAMPLER3D; }
"isamplerCube" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return ISAMPLERCUBE; }
"isamplerCubeArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return ISAMPLERCUBEARRAY; }
"isampler1DArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return ISAMPLER1DARRAY; }
"isampler2DArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return ISAMPLER2DARRAY; }
"usampler1D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return USAMPLER1D; }
"usampler2D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return USAMPLER2D; }
"usampler3D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return USAMPLER3D; }
"usamplerCube" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return USAMPLERCUBE; }
"usamplerCubeArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return USAMPLERCUBEARRAY; }
"usampler1DArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return USAMPLER1DARRAY; }
"usampler2DArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return USAMPLER2DARRAY; }
"samplerBuffer" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(SAMPLERBUFFER); }
"isamplerBuffer" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(ISAMPLERBUFFER); }
"usamplerBuffer" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(USAMPLERBUFFER); }
"sampler2DMS" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(SAMPLER2DMS); }
"isampler2DMS" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(ISAMPLER2DMS); }
"usampler2DMS" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(USAMPLER2DMS); }
"sampler2DMSArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(SAMPLER2DMSARRAY); }
"isampler2DMSArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(ISAMPLER2DMSARRAY); }
"usampler2DMSArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(USAMPLER2DMSARRAY); }
"image1D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(IMAGE1D); }
"iimage1D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(IIMAGE1D); }
"uimage1D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(UIMAGE1D); }
"image2D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(IMAGE2D); }
"iimage2D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(IIMAGE2D); }
"uimage2D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(UIMAGE2D); }
"image3D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(IMAGE3D); }
"iimage3D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(IIMAGE3D); }
"uimage3D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(UIMAGE3D); }
"image2DRect" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(IMAGE2DRECT); }
"iimage2DRect" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(IIMAGE2DRECT); }
"uimage2DRect" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(UIMAGE2DRECT); }
"imageCube" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(IMAGECUBE); }
"iimageCube" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(IIMAGECUBE); }
"uimageCube" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(UIMAGECUBE); }
"imageBuffer" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(IMAGEBUFFER); }
"iimageBuffer" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(IIMAGEBUFFER); }
"uimageBuffer" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(UIMAGEBUFFER); }
"image1DArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(IMAGE1DARRAY); }
"iimage1DArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(IIMAGE1DARRAY); }
"uimage1DArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(UIMAGE1DARRAY); }
"image2DArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(IMAGE2DARRAY); }
"iimage2DArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(IIMAGE2DARRAY); }
"uimage2DArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(UIMAGE2DARRAY); }
"imageCubeArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(IMAGECUBEARRAY); }
"iimageCubeArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(IIMAGECUBEARRAY); }
"uimageCubeArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(UIMAGECUBEARRAY); }
"image2DMS" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(IMAGE2DMS); }
"iimage2DMS" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(IIMAGE2DMS); }
"uimage2DMS" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(UIMAGE2DMS); }
"image2DMSArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(IMAGE2DMSARRAY); }
"iimage2DMSArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(IIMAGE2DMSARRAY); }
"uimage2DMSArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(UIMAGE2DMSARRAY); }
"struct" { pyylval->lex.line = yylineno; return(STRUCT); }
"asm" { PaReservedWord(); return 0; } "sampler1D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
if (parseContext.profile == EEsProfile)
PaReservedWord();
return SAMPLER1D;
}
"sampler3D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
if (parseContext.profile == EEsProfile && parseContext.version < 300)
PaReservedWord();
return SAMPLER3D;
}
"sampler1DShadow" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
if (parseContext.profile == EEsProfile)
PaReservedWord();
return SAMPLER1DSHADOW;
}
"sampler2DShadow" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
if (parseContext.profile == EEsProfile && parseContext.version < 300)
PaReservedWord();
return SAMPLER2DSHADOW;
}
"sampler2DRect" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
if (parseContext.profile == EEsProfile ||
parseContext.profile != EEsProfile && parseContext.version < 140)
PaReservedWord();
return SAMPLER2DRECT;
}
"sampler2DRectShadow" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
if (parseContext.profile == EEsProfile ||
parseContext.profile != EEsProfile && parseContext.version < 140)
PaReservedWord();
return SAMPLER2DRECTSHADOW;
}
"samplerCubeShadow" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaNonreservedKeyword(300, 130, parseContext, yylineno, yytext, pyylval, SAMPLERCUBESHADOW);
}
"sampler1DArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
if (parseContext.profile == EEsProfile && parseContext.version == 300)
PaReservedWord();
else if (parseContext.profile == EEsProfile && parseContext.version < 300 ||
parseContext.profile != EEsProfile && parseContext.version < 130)
return PaIdentOrType(yytext, parseContext, pyylval);
return SAMPLER1DARRAY;
}
"sampler2DArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaNonreservedKeyword(300, 130, parseContext, yylineno, yytext, pyylval, SAMPLER2DARRAY);
}
"sampler2DArrayShadow" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaNonreservedKeyword(300, 130, parseContext, yylineno, yytext, pyylval, SAMPLER2DARRAYSHADOW);
}
"samplerCubeArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
if (parseContext.profile == EEsProfile || parseContext.version < 400)
return PaIdentOrType(yytext, parseContext, pyylval);
return SAMPLERCUBEARRAY;
}
"sampler1DArrayShadow" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaES30ReservedFromGLSL(130, parseContext, yylineno, yytext, pyylval, SAMPLER1DARRAYSHADOW);
}
"samplerCubeArrayShadow" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
if (parseContext.profile == EEsProfile || parseContext.version < 400)
return PaIdentOrType(yytext, parseContext, pyylval);
return SAMPLERCUBEARRAYSHADOW;
}
"isampler1D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaES30ReservedFromGLSL(130, parseContext, yylineno, yytext, pyylval, ISAMPLER1D);
}
"isampler2D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaNonreservedKeyword(300, 130, parseContext, yylineno, yytext, pyylval, ISAMPLER2D);
}
"isampler3D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaNonreservedKeyword(300, 130, parseContext, yylineno, yytext, pyylval, ISAMPLER3D);
}
"isamplerCube" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaNonreservedKeyword(300, 130, parseContext, yylineno, yytext, pyylval, ISAMPLERCUBE);
}
"isampler1DArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaES30ReservedFromGLSL(130, parseContext, yylineno, yytext, pyylval, ISAMPLER1DARRAY);
}
"isampler2DArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaNonreservedKeyword(300, 130, parseContext, yylineno, yytext, pyylval, ISAMPLER2DARRAY);
}
"usampler1D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaES30ReservedFromGLSL(130, parseContext, yylineno, yytext, pyylval, USAMPLER1D);
}
"usampler2D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaNonreservedKeyword(300, 130, parseContext, yylineno, yytext, pyylval, USAMPLER2D);
}
"usampler3D" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaNonreservedKeyword(300, 130, parseContext, yylineno, yytext, pyylval, USAMPLER3D);
}
"usamplerCube" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaNonreservedKeyword(300, 130, parseContext, yylineno, yytext, pyylval, USAMPLERCUBE);
}
"usampler1DArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaES30ReservedFromGLSL(130, parseContext, yylineno, yytext, pyylval, USAMPLER1DARRAY);
}
"usampler2DArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaNonreservedKeyword(300, 130, parseContext, yylineno, yytext, pyylval, USAMPLER2DARRAY);
}
"isampler2DRect" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaES30ReservedFromGLSL(140, parseContext, yylineno, yytext, pyylval, ISAMPLER2DRECT);
}
"usampler2DRect" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaES30ReservedFromGLSL(140, parseContext, yylineno, yytext, pyylval, USAMPLER2DRECT);
}
"isamplerCubeArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
if (parseContext.profile == EEsProfile || parseContext.version < 400)
return PaIdentOrType(yytext, parseContext, pyylval);
return ISAMPLERCUBEARRAY;
}
"usamplerCubeArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
if (parseContext.profile == EEsProfile || parseContext.version < 400)
return PaIdentOrType(yytext, parseContext, pyylval);
return USAMPLERCUBEARRAY;
}
"samplerBuffer" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaES30ReservedFromGLSL(130, parseContext, yylineno, yytext, pyylval, SAMPLERBUFFER);
}
"isamplerBuffer" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaES30ReservedFromGLSL(140, parseContext, yylineno, yytext, pyylval, ISAMPLERBUFFER);
}
"usamplerBuffer" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaES30ReservedFromGLSL(140, parseContext, yylineno, yytext, pyylval, USAMPLERBUFFER);
}
"sampler2DMS" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaES30ReservedFromGLSL(150, parseContext, yylineno, yytext, pyylval, SAMPLER2DMS);
}
"isampler2DMS" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaES30ReservedFromGLSL(150, parseContext, yylineno, yytext, pyylval, ISAMPLER2DMS);
}
"usampler2DMS" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaES30ReservedFromGLSL(150, parseContext, yylineno, yytext, pyylval, USAMPLER2DMS);
}
"sampler2DMSArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaES30ReservedFromGLSL(150, parseContext, yylineno, yytext, pyylval, SAMPLER2DMSARRAY);
}
"isampler2DMSArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaES30ReservedFromGLSL(150, parseContext, yylineno, yytext, pyylval, ISAMPLER2DMSARRAY);
}
"usampler2DMSArray" { pyylval->lex.line = yylineno; parseContext.lexAfterType = true;
return PaES30ReservedFromGLSL(150, parseContext, yylineno, yytext, pyylval, USAMPLER2DMSARRAY);
}
"image1D" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, IMAGE1D); }
"iimage1D" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, IIMAGE1D); }
"uimage1D" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, UIMAGE1D); }
"image2D" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, IMAGE2D); }
"iimage2D" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, IIMAGE2D); }
"uimage2D" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, UIMAGE2D); }
"image3D" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, IMAGE3D); }
"iimage3D" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, IIMAGE3D); }
"uimage3D" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, UIMAGE3D); }
"image2DRect" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, IMAGE2DRECT); }
"iimage2DRect" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, IIMAGE2DRECT); }
"uimage2DRect" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, UIMAGE2DRECT); }
"imageCube" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, IMAGECUBE); }
"iimageCube" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, IIMAGECUBE); }
"uimageCube" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, UIMAGECUBE); }
"imageBuffer" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, IMAGEBUFFER); }
"iimageBuffer" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, IIMAGEBUFFER); }
"uimageBuffer" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, UIMAGEBUFFER); }
"image1DArray" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, IMAGE1DARRAY); }
"iimage1DArray" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, IIMAGE1DARRAY); }
"uimage1DArray" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, UIMAGE1DARRAY); }
"image2DArray" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, IMAGE2DARRAY); }
"iimage2DArray" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, IIMAGE2DARRAY); }
"uimage2DArray" { return Pa1stGenerationImage(parseContext, yylineno, yytext, pyylval, UIMAGE2DARRAY); }
"imageCubeArray" { return Pa2ndGenerationImage(parseContext, yylineno, yytext, pyylval, IMAGECUBEARRAY); }
"iimageCubeArray" { return Pa2ndGenerationImage(parseContext, yylineno, yytext, pyylval, IIMAGECUBEARRAY); }
"uimageCubeArray" { return Pa2ndGenerationImage(parseContext, yylineno, yytext, pyylval, UIMAGECUBEARRAY); }
"image2DMS" { return Pa2ndGenerationImage(parseContext, yylineno, yytext, pyylval, IMAGE2DMS); }
"iimage2DMS" { return Pa2ndGenerationImage(parseContext, yylineno, yytext, pyylval, IIMAGE2DMS); }
"uimage2DMS" { return Pa2ndGenerationImage(parseContext, yylineno, yytext, pyylval, UIMAGE2DMS); }
"image2DMSArray" { return Pa2ndGenerationImage(parseContext, yylineno, yytext, pyylval, IMAGE2DMSARRAY); }
"iimage2DMSArray" { return Pa2ndGenerationImage(parseContext, yylineno, yytext, pyylval, IIMAGE2DMSARRAY); }
"uimage2DMSArray" { return Pa2ndGenerationImage(parseContext, yylineno, yytext, pyylval, UIMAGE2DMSARRAY); }
"struct" { pyylval->lex.line = yylineno; return STRUCT; }
"asm" { PaReservedWord(); return 0; }
"class" { PaReservedWord(); return 0; } "class" { PaReservedWord(); return 0; }
"union" { PaReservedWord(); return 0; } "union" { PaReservedWord(); return 0; }
"enum" { PaReservedWord(); return 0; } "enum" { PaReservedWord(); return 0; }
"typedef" { PaReservedWord(); return 0; } "typedef" { PaReservedWord(); return 0; }
"template" { PaReservedWord(); return 0; } "template" { PaReservedWord(); return 0; }
"this" { PaReservedWord(); return 0; } "this" { PaReservedWord(); return 0; }
"packed" { PaReservedWord(); return 0; }
"resource" { if (parseContext.profile == EEsProfile && parseContext.version >= 300 || "packed" { pyylval->lex.line = yylineno;
parseContext.profile != EEsProfile && parseContext.version >= 420) if (parseContext.profile == EEsProfile && parseContext.version < 300 ||
return PaReservedWord(); parseContext.profile != EEsProfile && parseContext.version < 330) {
PaReservedWord();
return 0;
} else
return PaIdentOrType(yytext, parseContext, pyylval);
}
"resource" { bool reserved = parseContext.profile == EEsProfile && parseContext.version >= 300 ||
parseContext.profile != EEsProfile && parseContext.version >= 420;
return PaIdentOrReserved(reserved, parseContext, yylineno, yytext, pyylval);
} }
"goto" { PaReservedWord(); return 0; } "goto" { PaReservedWord(); return 0; }
"inline" { PaReservedWord(); return 0; } "inline" { PaReservedWord(); return 0; }
...@@ -323,9 +506,9 @@ int yy_input(char* buf, int max_size); ...@@ -323,9 +506,9 @@ int yy_input(char* buf, int max_size);
"fixed" { PaReservedWord(); return 0; } "fixed" { PaReservedWord(); return 0; }
"unsigned" { PaReservedWord(); return 0; } "unsigned" { PaReservedWord(); return 0; }
"superp" { bool reserved = (parseContext.profile == EEsProfile || parseContext.version >= 130); "superp" { bool reserved = parseContext.profile == EEsProfile || parseContext.version >= 130;
return PaIdentOrReserved(reserved, parseContext, yylineno, yytext, pyylval); } return PaIdentOrReserved(reserved, parseContext, yylineno, yytext, pyylval);
}
"input" { PaReservedWord(); return 0; } "input" { PaReservedWord(); return 0; }
"output" { PaReservedWord(); return 0; } "output" { PaReservedWord(); return 0; }
...@@ -348,78 +531,77 @@ int yy_input(char* buf, int max_size); ...@@ -348,78 +531,77 @@ int yy_input(char* buf, int max_size);
{L}({L}|{D})* { {L}({L}|{D})* {
pyylval->lex.line = yylineno; pyylval->lex.line = yylineno;
pyylval->lex.string = NewPoolTString(yytext); return PaIdentOrType(yytext, parseContext, pyylval);
return PaIdentOrType(*pyylval->lex.string, parseContext, pyylval->lex.symbol);
} }
0[xX]{H}+ { pyylval->lex.line = yylineno; pyylval->lex.i = strtoul(yytext, 0, 0); return(INTCONSTANT); } 0[xX]{H}+ { pyylval->lex.line = yylineno; pyylval->lex.i = strtoul(yytext, 0, 0); return INTCONSTANT; }
0{O}+ { pyylval->lex.line = yylineno; pyylval->lex.i = strtoul(yytext, 0, 0); return(INTCONSTANT); } 0{O}+ { pyylval->lex.line = yylineno; pyylval->lex.i = strtoul(yytext, 0, 0); return INTCONSTANT; }
0{D}+ { pyylval->lex.line = yylineno; parseContext.error(yylineno, "Invalid Octal number.", yytext, "", ""); parseContext.recover(); return 0;} 0{D}+ { pyylval->lex.line = yylineno; parseContext.error(yylineno, "Invalid Octal number.", yytext, "", ""); parseContext.recover(); return 0;}
{D}+ { pyylval->lex.line = yylineno; pyylval->lex.i = strtoul(yytext, 0, 0); return(INTCONSTANT); } {D}+ { pyylval->lex.line = yylineno; pyylval->lex.i = strtoul(yytext, 0, 0); return INTCONSTANT; }
0[xX]{H}+{U} { pyylval->lex.line = yylineno; pyylval->lex.u = strtoul(yytext, 0, 0); return(UINTCONSTANT); } 0[xX]{H}+{U} { pyylval->lex.line = yylineno; pyylval->lex.u = strtoul(yytext, 0, 0); return UINTCONSTANT; }
0{O}+{U} { pyylval->lex.line = yylineno; pyylval->lex.u = strtoul(yytext, 0, 0); return(UINTCONSTANT); } 0{O}+{U} { pyylval->lex.line = yylineno; pyylval->lex.u = strtoul(yytext, 0, 0); return UINTCONSTANT; }
0{D}+{U} { pyylval->lex.line = yylineno; parseContext.error(yylineno, "Invalid Octal number.", yytext, "", ""); parseContext.recover(); return 0;} 0{D}+{U} { pyylval->lex.line = yylineno; parseContext.error(yylineno, "Invalid Octal number.", yytext, "", ""); parseContext.recover(); return 0;}
{D}+{U} { pyylval->lex.line = yylineno; pyylval->lex.u = strtoul(yytext, 0, 0); return(UINTCONSTANT); } {D}+{U} { pyylval->lex.line = yylineno; pyylval->lex.u = strtoul(yytext, 0, 0); return UINTCONSTANT; }
{D}+{F} { pyylval->lex.line = yylineno; pyylval->lex.f = static_cast<float>(atof(yytext)); return(FLOATCONSTANT); } {D}+{F} { pyylval->lex.line = yylineno; pyylval->lex.f = static_cast<float>(atof(yytext)); return FLOATCONSTANT; }
{D}+{E}{F}? { pyylval->lex.line = yylineno; pyylval->lex.f = static_cast<float>(atof(yytext)); return(FLOATCONSTANT); } {D}+{E}{F}? { pyylval->lex.line = yylineno; pyylval->lex.f = static_cast<float>(atof(yytext)); return FLOATCONSTANT; }
{D}+"."{D}*({E})?{F}? { pyylval->lex.line = yylineno; pyylval->lex.f = static_cast<float>(atof(yytext)); return(FLOATCONSTANT); } {D}+"."{D}*({E})?{F}? { pyylval->lex.line = yylineno; pyylval->lex.f = static_cast<float>(atof(yytext)); return FLOATCONSTANT; }
"."{D}+({E})?{F}? { pyylval->lex.line = yylineno; pyylval->lex.f = static_cast<float>(atof(yytext)); return(FLOATCONSTANT); } "."{D}+({E})?{F}? { pyylval->lex.line = yylineno; pyylval->lex.f = static_cast<float>(atof(yytext)); return FLOATCONSTANT; }
{D}+{LF} { pyylval->lex.line = yylineno; pyylval->lex.d = atof(yytext); return(DOUBLECONSTANT); } {D}+{LF} { pyylval->lex.line = yylineno; pyylval->lex.d = atof(yytext); return DOUBLECONSTANT; }
{D}+{E}{LF} { pyylval->lex.line = yylineno; pyylval->lex.d = atof(yytext); return(DOUBLECONSTANT); } {D}+{E}{LF} { pyylval->lex.line = yylineno; pyylval->lex.d = atof(yytext); return DOUBLECONSTANT; }
{D}+"."{D}*({E})?{LF} { pyylval->lex.line = yylineno; pyylval->lex.d = atof(yytext); return(DOUBLECONSTANT); } {D}+"."{D}*({E})?{LF} { pyylval->lex.line = yylineno; pyylval->lex.d = atof(yytext); return DOUBLECONSTANT; }
"."{D}+({E})?{LF} { pyylval->lex.line = yylineno; pyylval->lex.d = atof(yytext); return(DOUBLECONSTANT); } "."{D}+({E})?{LF} { pyylval->lex.line = yylineno; pyylval->lex.d = atof(yytext); return DOUBLECONSTANT; }
"/*" { int ret = PaParseComment(pyylval->lex.line, parseContext); if (!ret) return ret; } "/*" { int ret = PaParseComment(pyylval->lex.line, parseContext); if (!ret) return ret; }
"+=" { pyylval->lex.line = yylineno; return(ADD_ASSIGN); } "+=" { pyylval->lex.line = yylineno; return ADD_ASSIGN; }
"-=" { pyylval->lex.line = yylineno; return(SUB_ASSIGN); } "-=" { pyylval->lex.line = yylineno; return SUB_ASSIGN; }
"*=" { pyylval->lex.line = yylineno; return(MUL_ASSIGN); } "*=" { pyylval->lex.line = yylineno; return MUL_ASSIGN; }
"/=" { pyylval->lex.line = yylineno; return(DIV_ASSIGN); } "/=" { pyylval->lex.line = yylineno; return DIV_ASSIGN; }
"%=" { pyylval->lex.line = yylineno; return(MOD_ASSIGN); } "%=" { pyylval->lex.line = yylineno; return MOD_ASSIGN; }
"<<=" { pyylval->lex.line = yylineno; return(LEFT_ASSIGN); } "<<=" { pyylval->lex.line = yylineno; return LEFT_ASSIGN; }
">>=" { pyylval->lex.line = yylineno; return(RIGHT_ASSIGN); } ">>=" { pyylval->lex.line = yylineno; return RIGHT_ASSIGN; }
"&=" { pyylval->lex.line = yylineno; return(AND_ASSIGN); } "&=" { pyylval->lex.line = yylineno; return AND_ASSIGN; }
"^=" { pyylval->lex.line = yylineno; return(XOR_ASSIGN); } "^=" { pyylval->lex.line = yylineno; return XOR_ASSIGN; }
"|=" { pyylval->lex.line = yylineno; return(OR_ASSIGN); } "|=" { pyylval->lex.line = yylineno; return OR_ASSIGN; }
"++" { pyylval->lex.line = yylineno; return(INC_OP); } "++" { pyylval->lex.line = yylineno; return INC_OP; }
"--" { pyylval->lex.line = yylineno; return(DEC_OP); } "--" { pyylval->lex.line = yylineno; return DEC_OP; }
"&&" { pyylval->lex.line = yylineno; return(AND_OP); } "&&" { pyylval->lex.line = yylineno; return AND_OP; }
"||" { pyylval->lex.line = yylineno; return(OR_OP); } "||" { pyylval->lex.line = yylineno; return OR_OP; }
"^^" { pyylval->lex.line = yylineno; return(XOR_OP); } "^^" { pyylval->lex.line = yylineno; return XOR_OP; }
"<=" { pyylval->lex.line = yylineno; return(LE_OP); } "<=" { pyylval->lex.line = yylineno; return LE_OP; }
">=" { pyylval->lex.line = yylineno; return(GE_OP); } ">=" { pyylval->lex.line = yylineno; return GE_OP; }
"==" { pyylval->lex.line = yylineno; return(EQ_OP); } "==" { pyylval->lex.line = yylineno; return EQ_OP; }
"!=" { pyylval->lex.line = yylineno; return(NE_OP); } "!=" { pyylval->lex.line = yylineno; return NE_OP; }
"<<" { pyylval->lex.line = yylineno; return(LEFT_OP); } "<<" { pyylval->lex.line = yylineno; return LEFT_OP; }
">>" { pyylval->lex.line = yylineno; return(RIGHT_OP); } ">>" { pyylval->lex.line = yylineno; return RIGHT_OP; }
";" { pyylval->lex.line = yylineno; parseContext.lexAfterType = false; return(SEMICOLON); } ";" { pyylval->lex.line = yylineno; parseContext.lexAfterType = false; return SEMICOLON; }
("{"|"<%") { pyylval->lex.line = yylineno; parseContext.lexAfterType = false; return(LEFT_BRACE); } ("{"|"<%") { pyylval->lex.line = yylineno; parseContext.lexAfterType = false; return LEFT_BRACE; }
("}"|"%>") { pyylval->lex.line = yylineno; return(RIGHT_BRACE); } ("}"|"%>") { pyylval->lex.line = yylineno; return RIGHT_BRACE; }
"," { pyylval->lex.line = yylineno; if (parseContext.inTypeParen) parseContext.lexAfterType = false; return(COMMA); } "," { pyylval->lex.line = yylineno; if (parseContext.inTypeParen) parseContext.lexAfterType = false; return COMMA; }
":" { pyylval->lex.line = yylineno; return(COLON); } ":" { pyylval->lex.line = yylineno; return COLON; }
"=" { pyylval->lex.line = yylineno; parseContext.lexAfterType = false; return(EQUAL); } "=" { pyylval->lex.line = yylineno; parseContext.lexAfterType = false; return EQUAL; }
"(" { pyylval->lex.line = yylineno; parseContext.lexAfterType = false; parseContext.inTypeParen = true; return(LEFT_PAREN); } "(" { pyylval->lex.line = yylineno; parseContext.lexAfterType = false; parseContext.inTypeParen = true; return LEFT_PAREN; }
")" { pyylval->lex.line = yylineno; parseContext.inTypeParen = false; return(RIGHT_PAREN); } ")" { pyylval->lex.line = yylineno; parseContext.inTypeParen = false; return RIGHT_PAREN; }
("["|"<:") { pyylval->lex.line = yylineno; return(LEFT_BRACKET); } ("["|"<:") { pyylval->lex.line = yylineno; return LEFT_BRACKET; }
("]"|":>") { pyylval->lex.line = yylineno; return(RIGHT_BRACKET); } ("]"|":>") { pyylval->lex.line = yylineno; return RIGHT_BRACKET; }
"." { BEGIN(FIELDS); return(DOT); } "." { BEGIN(FIELDS); return DOT; }
"!" { pyylval->lex.line = yylineno; return(BANG); } "!" { pyylval->lex.line = yylineno; return BANG; }
"-" { pyylval->lex.line = yylineno; return(DASH); } "-" { pyylval->lex.line = yylineno; return DASH; }
"~" { pyylval->lex.line = yylineno; return(TILDE); } "~" { pyylval->lex.line = yylineno; return TILDE; }
"+" { pyylval->lex.line = yylineno; return(PLUS); } "+" { pyylval->lex.line = yylineno; return PLUS; }
"*" { pyylval->lex.line = yylineno; return(STAR); } "*" { pyylval->lex.line = yylineno; return STAR; }
"/" { pyylval->lex.line = yylineno; return(SLASH); } "/" { pyylval->lex.line = yylineno; return SLASH; }
"%" { pyylval->lex.line = yylineno; return(PERCENT); } "%" { pyylval->lex.line = yylineno; return PERCENT; }
"<" { pyylval->lex.line = yylineno; return(LEFT_ANGLE); } "<" { pyylval->lex.line = yylineno; return LEFT_ANGLE; }
">" { pyylval->lex.line = yylineno; return(RIGHT_ANGLE); } ">" { pyylval->lex.line = yylineno; return RIGHT_ANGLE; }
"|" { pyylval->lex.line = yylineno; return(VERTICAL_BAR); } "|" { pyylval->lex.line = yylineno; return VERTICAL_BAR; }
"^" { pyylval->lex.line = yylineno; return(CARET); } "^" { pyylval->lex.line = yylineno; return CARET; }
"&" { pyylval->lex.line = yylineno; return(AMPERSAND); } "&" { pyylval->lex.line = yylineno; return AMPERSAND; }
"?" { pyylval->lex.line = yylineno; return(QUESTION); } "?" { pyylval->lex.line = yylineno; return QUESTION; }
<FIELDS>{L}({L}|{D})* { <FIELDS>{L}({L}|{D})* {
BEGIN(INITIAL); BEGIN(INITIAL);
...@@ -553,21 +735,30 @@ void yyerror(const char *s) ...@@ -553,21 +735,30 @@ void yyerror(const char *s)
} }
} }
int PaReservedWord() void PaReservedWord()
{ {
GlobalParseContext->error(yylineno, "Reserved word.", yytext, "", ""); GlobalParseContext->error(yylineno, "Reserved word.", yytext, "", "");
GlobalParseContext->recover(); GlobalParseContext->recover();
}
return 0; void PaCompatibilityWord(TParseContext& parseContextlocal)
{
if (parseContextlocal.profile != EEsProfile && parseContextlocal.profile != ECompatibilityProfile &&
parseContextlocal.version > 150) {
GlobalParseContext->error(yylineno, "Keyword requires compatibility profile.", yytext, "", "");
GlobalParseContext->recover();
}
} }
int PaIdentOrType(TString& id, TParseContext& parseContextLocal, TSymbol*& symbol) int PaIdentOrType(const char* yytext, TParseContext& parseContextLocal, YYSTYPE* pyylval)
{ {
symbol = parseContextLocal.symbolTable.find(id); pyylval->lex.string = NewPoolTString(yytext);
if (parseContextLocal.lexAfterType == false && symbol) { pyylval->lex.symbol = parseContextLocal.symbolTable.find(*pyylval->lex.string);
if (TVariable* variable = symbol->getAsVariable()) { if (parseContextLocal.lexAfterType == false && pyylval->lex.symbol) {
if (TVariable* variable = pyylval->lex.symbol->getAsVariable()) {
if (variable->isUserType()) { if (variable->isUserType()) {
parseContextLocal.lexAfterType = true; parseContextLocal.lexAfterType = true;
return TYPE_NAME; return TYPE_NAME;
} }
} }
...@@ -578,89 +769,151 @@ int PaIdentOrType(TString& id, TParseContext& parseContextLocal, TSymbol*& symbo ...@@ -578,89 +769,151 @@ int PaIdentOrType(TString& id, TParseContext& parseContextLocal, TSymbol*& symbo
int PaIdentOrReserved(bool reserved, TParseContext& pc, int line, const char* text, YYSTYPE* pyylval) int PaIdentOrReserved(bool reserved, TParseContext& pc, int line, const char* text, YYSTYPE* pyylval)
{ {
if (reserved) pyylval->lex.line = line;
if (reserved) {
PaReservedWord(); PaReservedWord();
pyylval->lex.line = line; return 0;
pyylval->lex.string = NewPoolTString(text); }
if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) { if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) {
pc.infoSink.info.message(EPrefixWarning, pyylval->lex.string->c_str(), yylineno); pc.infoSink.info.message(EPrefixWarning, yytext, yylineno);
pc.infoSink.info.message(EPrefixWarning, "using future reserved keyword", yylineno); pc.infoSink.info.message(EPrefixWarning, "using future reserved keyword", yylineno);
} }
return PaIdentOrType(*pyylval->lex.string, pc, pyylval->lex.symbol); return PaIdentOrType(text, pc, pyylval);
} }
// For keywords that suddenly showed up on non-ES (not previously reserved)
// but then got reserved by ES 3.0.
int PaES30ReservedFromGLSL(int version, TParseContext& pc, int line, const char* text, YYSTYPE* pyylval, int keyword) int PaES30ReservedFromGLSL(int version, TParseContext& pc, int line, const char* text, YYSTYPE* pyylval, int keyword)
{ {
pyylval->lex.line = line;
if (pc.profile == EEsProfile && pc.version < 300 || if (pc.profile == EEsProfile && pc.version < 300 ||
pc.profile != EEsProfile && pc.version < version) { pc.profile != EEsProfile && pc.version < version) {
pyylval->lex.line = yylineno;
pyylval->lex.string = NewPoolTString(yytext);
if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) { if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) {
pc.infoSink.info.message(EPrefixWarning, pyylval->lex.string->c_str(), yylineno); pc.infoSink.info.message(EPrefixWarning, text, yylineno);
pc.infoSink.info.message(EPrefixWarning, "future reserved word in ES 300 and keyword in GLSL", yylineno); pc.infoSink.info.message(EPrefixWarning, "future reserved word in ES 300 and keyword in GLSL", yylineno);
} }
return PaIdentOrType(*pyylval->lex.string, pc, pyylval->lex.symbol); return PaIdentOrType(text, pc, pyylval);
} else if (pc.profile == EEsProfile && pc.version >= 300) } else if (pc.profile == EEsProfile && pc.version >= 300)
PaReservedWord();
return PaReservedWord();
else {
pyylval->lex.line = yylineno;
return keyword; return keyword;
}
// For a keyword that was never reserved, until it suddenly
// showed up, both in an es version and a non-ES version.
int PaNonreservedKeyword(int esVersion, int nonEsVersion, TParseContext& pc, int line, const char* text, YYSTYPE* pyylval, int keyword)
{
pyylval->lex.line = line;
if (pc.profile == EEsProfile && pc.version < esVersion ||
pc.profile != EEsProfile && pc.version < nonEsVersion) {
if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) {
pc.infoSink.info.message(EPrefixWarning, text, yylineno);
pc.infoSink.info.message(EPrefixWarning, "using future keyword", yylineno);
}
return PaIdentOrType(text, pc, pyylval);
} }
return keyword;
} }
int PaPrecisionKeyword(TParseContext& pc, int line, const char* text, YYSTYPE* pyylval, int keyword) int PaPrecisionKeyword(TParseContext& pc, int line, const char* text, YYSTYPE* pyylval, int keyword)
{ {
pyylval->lex.line = line;
if (pc.profile == EEsProfile || pc.version >= 130) if (pc.profile == EEsProfile || pc.version >= 130)
return keyword; return keyword;
pyylval->lex.line = line;
pyylval->lex.string = NewPoolTString(text);
if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) { if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) {
pc.infoSink.info.message(EPrefixWarning, pyylval->lex.string->c_str(), yylineno); pc.infoSink.info.message(EPrefixWarning, text, yylineno);
pc.infoSink.info.message(EPrefixWarning, "using ES precision qualifier keyword", yylineno); pc.infoSink.info.message(EPrefixWarning, "using ES precision qualifier keyword", yylineno);
} }
return PaIdentOrType(*pyylval->lex.string, pc, pyylval->lex.symbol); return PaIdentOrType(text, pc, pyylval);
} }
int PaMatNxM(TParseContext& pc, int line, const char* text, YYSTYPE* pyylval, int keyword) int PaMatNxM(TParseContext& pc, int line, const char* text, YYSTYPE* pyylval, int keyword)
{ {
pyylval->lex.line = line;
pc.lexAfterType = true;
if (pc.version > 110) if (pc.version > 110)
return keyword; return keyword;
pyylval->lex.line = line;
pyylval->lex.string = NewPoolTString(text);
if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) { if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) {
pc.infoSink.info.message(EPrefixWarning, pyylval->lex.string->c_str(), yylineno); pc.infoSink.info.message(EPrefixWarning, text, yylineno);
pc.infoSink.info.message(EPrefixWarning, "using future non-square matrix type keyword", yylineno); pc.infoSink.info.message(EPrefixWarning, "using future non-square matrix type keyword", yylineno);
} }
return PaIdentOrType(*pyylval->lex.string, pc, pyylval->lex.symbol); return PaIdentOrType(text, pc, pyylval);
} }
int PaDMat(TParseContext& pc, int line, const char* text, YYSTYPE* pyylval, int keyword) int PaDMat(TParseContext& pc, int line, const char* text, YYSTYPE* pyylval, int keyword)
{ {
pyylval->lex.line = line;
pc.lexAfterType = true;
if (pc.profile == EEsProfile && pc.version >= 300) { if (pc.profile == EEsProfile && pc.version >= 300) {
PaReservedWord(); PaReservedWord();
return 0;
return keyword;
} }
if (pc.profile != EEsProfile && pc.version >= 400) if (pc.profile != EEsProfile && pc.version >= 400)
return keyword; return keyword;
if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) {
pc.infoSink.info.message(EPrefixWarning, text, yylineno);
pc.infoSink.info.message(EPrefixWarning, "using future type keyword", yylineno);
}
return PaIdentOrType(text, pc, pyylval);
}
int Pa1stGenerationImage(TParseContext& pc, int line, const char* text, YYSTYPE* pyylval, int keyword)
{
pyylval->lex.line = line; pyylval->lex.line = line;
pyylval->lex.string = NewPoolTString(text); pc.lexAfterType = true;
if (pc.profile != EEsProfile && pc.version >= 420)
return keyword;
if (pc.profile == EEsProfile && pc.version >= 300 ||
pc.profile != EEsProfile && pc.version >= 130) {
PaReservedWord();
return keyword;
}
if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) {
pc.infoSink.info.message(EPrefixWarning, text, yylineno);
pc.infoSink.info.message(EPrefixWarning, "using future type keyword", yylineno);
}
return PaIdentOrType(text, pc, pyylval);
}
int Pa2ndGenerationImage(TParseContext& pc, int line, const char* text, YYSTYPE* pyylval, int keyword)
{
pyylval->lex.line = line;
pc.lexAfterType = true;
if (pc.profile != EEsProfile && pc.version >= 420)
return keyword;
if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) { if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) {
pc.infoSink.info.message(EPrefixWarning, pyylval->lex.string->c_str(), yylineno); pc.infoSink.info.message(EPrefixWarning, text, yylineno);
pc.infoSink.info.message(EPrefixWarning, "using future type keyword", yylineno); pc.infoSink.info.message(EPrefixWarning, "using future type keyword", yylineno);
} }
return PaIdentOrType(*pyylval->lex.string, pc, pyylval->lex.symbol); return PaIdentOrType(text, pc, pyylval);
} }
int PaParseComment(int& lineno, TParseContext& parseContextLocal) int PaParseComment(int& lineno, TParseContext& parseContextLocal)
......
...@@ -1619,24 +1619,24 @@ interpolation_qualifier ...@@ -1619,24 +1619,24 @@ interpolation_qualifier
: SMOOTH { : SMOOTH {
if (parseContext.globalErrorCheck($1.line, parseContext.symbolTable.atGlobalLevel(), "smooth")) if (parseContext.globalErrorCheck($1.line, parseContext.symbolTable.atGlobalLevel(), "smooth"))
parseContext.recover(); parseContext.recover();
parseContext.profileRequires($$.line, ENoProfile, 130, 0, "smooth"); parseContext.profileRequires($1.line, ENoProfile, 130, 0, "smooth");
parseContext.profileRequires($$.line, EEsProfile, 300, 0, "smooth"); parseContext.profileRequires($1.line, EEsProfile, 300, 0, "smooth");
$$.init($1.line); $$.init($1.line);
$$.qualifier.smooth = true; $$.qualifier.smooth = true;
} }
| FLAT { | FLAT {
if (parseContext.globalErrorCheck($1.line, parseContext.symbolTable.atGlobalLevel(), "flat")) if (parseContext.globalErrorCheck($1.line, parseContext.symbolTable.atGlobalLevel(), "flat"))
parseContext.recover(); parseContext.recover();
parseContext.profileRequires($$.line, ENoProfile, 130, 0, "flat"); parseContext.profileRequires($1.line, ENoProfile, 130, 0, "flat");
parseContext.profileRequires($$.line, EEsProfile, 300, 0, "flat"); parseContext.profileRequires($1.line, EEsProfile, 300, 0, "flat");
$$.init($1.line); $$.init($1.line);
$$.qualifier.flat = true; $$.qualifier.flat = true;
} }
| NOPERSPECTIVE { | NOPERSPECTIVE {
if (parseContext.globalErrorCheck($1.line, parseContext.symbolTable.atGlobalLevel(), "noperspective")) if (parseContext.globalErrorCheck($1.line, parseContext.symbolTable.atGlobalLevel(), "noperspective"))
parseContext.recover(); parseContext.recover();
parseContext.requireProfile($$.line, static_cast<EProfileMask>(~EEsProfileMask), "noperspective"); parseContext.requireProfile($1.line, static_cast<EProfileMask>(~EEsProfileMask), "noperspective");
parseContext.profileRequires($$.line, ENoProfile, 130, 0, "noperspective"); parseContext.profileRequires($1.line, ENoProfile, 130, 0, "noperspective");
$$.init($1.line); $$.init($1.line);
$$.qualifier.nopersp = true; $$.qualifier.nopersp = true;
} }
...@@ -1769,8 +1769,8 @@ storage_qualifier ...@@ -1769,8 +1769,8 @@ storage_qualifier
$$.qualifier.storage = EvqOut; $$.qualifier.storage = EvqOut;
} }
| CENTROID { | CENTROID {
parseContext.profileRequires($$.line, ENoProfile, 120, 0, "centroid"); parseContext.profileRequires($1.line, ENoProfile, 120, 0, "centroid");
parseContext.profileRequires($$.line, EEsProfile, 300, 0, "centroid"); parseContext.profileRequires($1.line, EEsProfile, 300, 0, "centroid");
if (parseContext.globalErrorCheck($1.line, parseContext.symbolTable.atGlobalLevel(), "centroid")) if (parseContext.globalErrorCheck($1.line, parseContext.symbolTable.atGlobalLevel(), "centroid"))
parseContext.recover(); parseContext.recover();
$$.init($1.line); $$.init($1.line);
...@@ -1801,6 +1801,9 @@ storage_qualifier ...@@ -1801,6 +1801,9 @@ storage_qualifier
$$.qualifier.storage = EvqUniform; // TODO: 4.0 functionality: implement BUFFER $$.qualifier.storage = EvqUniform; // TODO: 4.0 functionality: implement BUFFER
} }
| SHARED { | SHARED {
parseContext.requireProfile($1.line, static_cast<EProfileMask>(~EEsProfileMask), "shared");
parseContext.profileRequires($1.line, ECoreProfile, 430, 0, "shared");
parseContext.requireStage($1.line, EShLangComputeMask, "shared");
$$.init($1.line); $$.init($1.line);
$$.qualifier.shared = true; $$.qualifier.shared = true;
} }
......
...@@ -77,6 +77,7 @@ typedef enum { ...@@ -77,6 +77,7 @@ typedef enum {
EShLangTessEvaluation, EShLangTessEvaluation,
EShLangGeometry, EShLangGeometry,
EShLangFragment, EShLangFragment,
EShLangCompute,
EShLangCount, EShLangCount,
} EShLanguage; } EShLanguage;
...@@ -86,6 +87,7 @@ typedef enum { ...@@ -86,6 +87,7 @@ typedef enum {
EShLangTessEvaluationMask = (1 << EShLangTessEvaluation), EShLangTessEvaluationMask = (1 << EShLangTessEvaluation),
EShLangGeometryMask = (1 << EShLangGeometry), EShLangGeometryMask = (1 << EShLangGeometry),
EShLangFragmentMask = (1 << EShLangFragment), EShLangFragmentMask = (1 << EShLangFragment),
EShLangComputeMask = (1 << EShLangCompute),
} EShLanguageMask; } EShLanguageMask;
extern const char* StageName[EShLangCount]; extern const char* StageName[EShLangCount];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment