From 534ec62152e70ed8f6467feaf07b2db2197e11b1 Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Thu, 2 Aug 2012 08:17:55 -0700 Subject: glsl: parse GLSL ES 3.00 keywords correctly. GLSL ES 3.00 adds the following keywords over GLSL 1.00: uint, uvec[2-4], matNxM, centroid, flat, smooth, various samplers, layout, switch, default, and case. Additionally, it reserves a large number of keywords, some of which were already reserved in versions of desktop GL that Mesa supports, some of which are new to Mesa. A few of the reserved keywords in GLSL ES 3.00 are keywords that are supported in all other versions of GLSL: attribute, varying, sampler1D, sampler1DShador, sampler2DRect, and sampler2DRectShadow. This patch updates the lexer to handle all of the new keywords correctly when the language being parsed is GLSL 3.00 ES. Reviewed-by: Ian Romanick Reviewed-by: Kenneth Graunke Acked-by: Carl Worth --- src/glsl/glsl_parser.yy | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/glsl/glsl_parser.yy') diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy index ef2d24f08d..6cc1a513bd 100644 --- a/src/glsl/glsl_parser.yy +++ b/src/glsl/glsl_parser.yy @@ -137,6 +137,9 @@ static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg) %token HVEC2 HVEC3 HVEC4 DVEC2 DVEC3 DVEC4 FVEC2 FVEC3 FVEC4 %token SAMPLER3DRECT %token SIZEOF CAST NAMESPACE USING +%token COHERENT RESTRICT READONLY WRITEONLY RESOURCE ATOMIC_UINT PATCH SAMPLE +%token SUBROUTINE SAMPLER2DMS ISAMPLER2DMS USAMPLER2DMS SAMPLER2DMSARRAY +%token ISAMPLER2DMSARRAY USAMPLER2DMSARRAY %token ERROR_TOK -- cgit v1.2.3