glsl: Mark [iu]sampler{Buffer,2DRect}as reserved in GLSL 1.40.
authorEric Anholt <eric@anholt.net>
Fri, 13 Apr 2012 19:34:45 +0000 (12:34 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 16 Apr 2012 18:28:21 +0000 (11:28 -0700)
The non-integer versions were already reserved in 1.30, but apparently
these were forgotten.

Fixes piglit glsl-1.40/compiler/reserved/

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/glsl_lexer.ll
src/glsl/glsl_parser.yy

index 936a90726f06cb0af59d85ffffaf7166d43f6902..2028d7f47683799b24390adb04219f79daa4814d 100644 (file)
@@ -470,6 +470,12 @@ iimageBuffer       KEYWORD(130, 999, IIMAGEBUFFER);
 uimageBuffer   KEYWORD(130, 999, UIMAGEBUFFER);
 row_major      KEYWORD(130, 999, ROW_MAJOR);
 
+    /* Additional reserved words in GLSL 1.40 */
+isampler2DRect KEYWORD(140, 140, ISAMPLER2DRECT);
+usampler2DRect KEYWORD(140, 140, USAMPLER2DRECT);
+isamplerBuffer KEYWORD(140, 140, ISAMPLERBUFFER);
+usamplerBuffer KEYWORD(140, 140, USAMPLERBUFFER);
+
 [_a-zA-Z][_a-zA-Z0-9]* {
                            struct _mesa_glsl_parse_state *state = yyextra;
                            void *ctx = state;  
index 5753acf3cd1c430f13abb0cf6eeb0127d0c25a0e..5ca8740c4ff26ec9e174d4fedad166cfefe4a2e1 100644 (file)
@@ -103,6 +103,8 @@ static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg)
 %token SAMPLER2DARRAYSHADOW ISAMPLER1D ISAMPLER2D ISAMPLER3D ISAMPLERCUBE
 %token ISAMPLER1DARRAY ISAMPLER2DARRAY USAMPLER1D USAMPLER2D USAMPLER3D
 %token USAMPLERCUBE USAMPLER1DARRAY USAMPLER2DARRAY
+%token SAMPLER2DRECT ISAMPLER2DRECT USAMPLER2DRECT SAMPLER2DRECTSHADOW
+%token SAMPLERBUFFER ISAMPLERBUFFER USAMPLERBUFFER
 %token SAMPLEREXTERNALOES
 %token STRUCT VOID_TOK WHILE
 %token <identifier> IDENTIFIER TYPE_IDENTIFIER NEW_IDENTIFIER
@@ -130,12 +132,12 @@ static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg)
 %token INLINE_TOK NOINLINE VOLATILE PUBLIC_TOK STATIC EXTERN EXTERNAL
 %token LONG_TOK SHORT_TOK DOUBLE_TOK HALF FIXED_TOK UNSIGNED INPUT_TOK OUPTUT
 %token HVEC2 HVEC3 HVEC4 DVEC2 DVEC3 DVEC4 FVEC2 FVEC3 FVEC4
-%token SAMPLER2DRECT SAMPLER3DRECT SAMPLER2DRECTSHADOW
+%token SAMPLER3DRECT
 %token SIZEOF CAST NAMESPACE USING
 
 %token ERROR_TOK
 
-%token COMMON PARTITION ACTIVE SAMPLERBUFFER FILTER
+%token COMMON PARTITION ACTIVE FILTER
 %token  IMAGE1D  IMAGE2D  IMAGE3D  IMAGECUBE  IMAGE1DARRAY  IMAGE2DARRAY
 %token IIMAGE1D IIMAGE2D IIMAGE3D IIMAGECUBE IIMAGE1DARRAY IIMAGE2DARRAY
 %token UIMAGE1D UIMAGE2D UIMAGE3D UIMAGECUBE UIMAGE1DARRAY UIMAGE2DARRAY
@@ -1428,16 +1430,20 @@ basic_type_specifier_nonarray:
        | SAMPLERBUFFER         { $$ = "samplerBuffer"; }
        | ISAMPLER1D            { $$ = "isampler1D"; }
        | ISAMPLER2D            { $$ = "isampler2D"; }
+       | ISAMPLER2DRECT        { $$ = "isampler2DRect"; }
        | ISAMPLER3D            { $$ = "isampler3D"; }
        | ISAMPLERCUBE          { $$ = "isamplerCube"; }
        | ISAMPLER1DARRAY       { $$ = "isampler1DArray"; }
        | ISAMPLER2DARRAY       { $$ = "isampler2DArray"; }
+       | ISAMPLERBUFFER        { $$ = "isamplerBuffer"; }
        | USAMPLER1D            { $$ = "usampler1D"; }
        | USAMPLER2D            { $$ = "usampler2D"; }
+       | USAMPLER2DRECT        { $$ = "usampler2DRect"; }
        | USAMPLER3D            { $$ = "usampler3D"; }
        | USAMPLERCUBE          { $$ = "usamplerCube"; }
        | USAMPLER1DARRAY       { $$ = "usampler1DArray"; }
        | USAMPLER2DARRAY       { $$ = "usampler2DArray"; }
+       | USAMPLERBUFFER        { $$ = "usamplerBuffer"; }
        ;
 
 precision_qualifier: