diff options
Diffstat (limited to 'src/glsl/glsl_parser.yy')
-rw-r--r-- | src/glsl/glsl_parser.yy | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy index 7fb8c38abe3..596e432f376 100644 --- a/src/glsl/glsl_parser.yy +++ b/src/glsl/glsl_parser.yy @@ -94,6 +94,7 @@ static bool match_layout_qualifier(const char *s1, const char *s2, %union { int n; float real; + double dreal; const char *identifier; struct ast_type_qualifier type_qualifier; @@ -128,14 +129,17 @@ static bool match_layout_qualifier(const char *s1, const char *s2, } selection_rest_statement; } -%token ATTRIBUTE CONST_TOK BOOL_TOK FLOAT_TOK INT_TOK UINT_TOK +%token ATTRIBUTE CONST_TOK BOOL_TOK FLOAT_TOK INT_TOK UINT_TOK DOUBLE_TOK %token BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT -%token BVEC2 BVEC3 BVEC4 IVEC2 IVEC3 IVEC4 UVEC2 UVEC3 UVEC4 VEC2 VEC3 VEC4 +%token BVEC2 BVEC3 BVEC4 IVEC2 IVEC3 IVEC4 UVEC2 UVEC3 UVEC4 VEC2 VEC3 VEC4 DVEC2 DVEC3 DVEC4 %token CENTROID IN_TOK OUT_TOK INOUT_TOK UNIFORM VARYING SAMPLE %token NOPERSPECTIVE FLAT SMOOTH %token MAT2X2 MAT2X3 MAT2X4 %token MAT3X2 MAT3X3 MAT3X4 %token MAT4X2 MAT4X3 MAT4X4 +%token DMAT2X2 DMAT2X3 DMAT2X4 +%token DMAT3X2 DMAT3X3 DMAT3X4 +%token DMAT4X2 DMAT4X3 DMAT4X4 %token SAMPLER1D SAMPLER2D SAMPLER3D SAMPLERCUBE SAMPLER1DSHADOW SAMPLER2DSHADOW %token SAMPLERCUBESHADOW SAMPLER1DARRAY SAMPLER2DARRAY SAMPLER1DARRAYSHADOW %token SAMPLER2DARRAYSHADOW SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW @@ -162,6 +166,7 @@ static bool match_layout_qualifier(const char *s1, const char *s2, %type <identifier> any_identifier %type <interface_block> instance_name_opt %token <real> FLOATCONSTANT +%token <dreal> DOUBLECONSTANT %token <n> INTCONSTANT UINTCONSTANT BOOLCONSTANT %token <identifier> FIELD_SELECTION %token LEFT_OP RIGHT_OP @@ -182,8 +187,8 @@ static bool match_layout_qualifier(const char *s1, const char *s2, */ %token ASM CLASS UNION ENUM TYPEDEF TEMPLATE THIS PACKED_TOK GOTO %token INLINE_TOK NOINLINE PUBLIC_TOK STATIC EXTERN EXTERNAL -%token LONG_TOK SHORT_TOK DOUBLE_TOK HALF FIXED_TOK UNSIGNED INPUT_TOK -%token HVEC2 HVEC3 HVEC4 DVEC2 DVEC3 DVEC4 FVEC2 FVEC3 FVEC4 +%token LONG_TOK SHORT_TOK HALF FIXED_TOK UNSIGNED INPUT_TOK +%token HVEC2 HVEC3 HVEC4 FVEC2 FVEC3 FVEC4 %token SAMPLER3DRECT %token SIZEOF CAST NAMESPACE USING %token RESOURCE PATCH @@ -434,6 +439,13 @@ primary_expression: $$->set_location(@1); $$->primary_expression.float_constant = $1; } + | DOUBLECONSTANT + { + void *ctx = state; + $$ = new(ctx) ast_expression(ast_double_constant, NULL, NULL, NULL); + $$->set_location(@1); + $$->primary_expression.double_constant = $1; + } | BOOLCONSTANT { void *ctx = state; @@ -1864,6 +1876,7 @@ type_specifier_nonarray: basic_type_specifier_nonarray: VOID_TOK { $$ = "void"; } | FLOAT_TOK { $$ = "float"; } + | DOUBLE_TOK { $$ = "double"; } | INT_TOK { $$ = "int"; } | UINT_TOK { $$ = "uint"; } | BOOL_TOK { $$ = "bool"; } @@ -1879,6 +1892,9 @@ basic_type_specifier_nonarray: | UVEC2 { $$ = "uvec2"; } | UVEC3 { $$ = "uvec3"; } | UVEC4 { $$ = "uvec4"; } + | DVEC2 { $$ = "dvec2"; } + | DVEC3 { $$ = "dvec3"; } + | DVEC4 { $$ = "dvec4"; } | MAT2X2 { $$ = "mat2"; } | MAT2X3 { $$ = "mat2x3"; } | MAT2X4 { $$ = "mat2x4"; } @@ -1888,6 +1904,15 @@ basic_type_specifier_nonarray: | MAT4X2 { $$ = "mat4x2"; } | MAT4X3 { $$ = "mat4x3"; } | MAT4X4 { $$ = "mat4"; } + | DMAT2X2 { $$ = "dmat2"; } + | DMAT2X3 { $$ = "dmat2x3"; } + | DMAT2X4 { $$ = "dmat2x4"; } + | DMAT3X2 { $$ = "dmat3x2"; } + | DMAT3X3 { $$ = "dmat3"; } + | DMAT3X4 { $$ = "dmat3x4"; } + | DMAT4X2 { $$ = "dmat4x2"; } + | DMAT4X3 { $$ = "dmat4x3"; } + | DMAT4X4 { $$ = "dmat4"; } | SAMPLER1D { $$ = "sampler1D"; } | SAMPLER2D { $$ = "sampler2D"; } | SAMPLER2DRECT { $$ = "sampler2DRect"; } |