summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2010-10-05 16:14:18 -0700
committerIan Romanick <[email protected]>2010-10-08 14:21:22 -0700
commitdd93035a4df9daaad8cb47f2cc412d5dd3a9e3c8 (patch)
treefc5677ca86dda63505177b40ccf877838c3200bb /src/glsl
parent4b5489dd6f6d21c9d2e3f3d6d6467dcd429264a2 (diff)
glsl: Refactor 'layout' grammar to match GLSL 1.60 spec grammar
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/glsl_parser.ypp31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/glsl/glsl_parser.ypp b/src/glsl/glsl_parser.ypp
index 0df1e480ce3..9d311093ba6 100644
--- a/src/glsl/glsl_parser.ypp
+++ b/src/glsl/glsl_parser.ypp
@@ -139,7 +139,7 @@
%type <type_qualifier> type_qualifier
%type <type_qualifier> storage_qualifier
%type <type_qualifier> interpolation_qualifier
-%type <type_qualifier> opt_layout_qualifier layout_qualifier
+%type <type_qualifier> layout_qualifier
%type <type_qualifier> layout_qualifier_id_list layout_qualifier_id
%type <type_specifier> type_specifier
%type <type_specifier> type_specifier_no_prec
@@ -959,11 +959,6 @@ fully_specified_type:
}
;
-opt_layout_qualifier:
- { $$.i = 0; }
- | layout_qualifier
- ;
-
layout_qualifier:
LAYOUT_TOK '(' layout_qualifier_id_list ')'
{
@@ -1025,23 +1020,39 @@ parameter_type_qualifier:
type_qualifier:
storage_qualifier
- | interpolation_qualifier type_qualifier
+ | layout_qualifier
+ | layout_qualifier storage_qualifier
+ {
+ $$.i = $1.i | $2.i;
+ }
+ | interpolation_qualifier
+ | interpolation_qualifier storage_qualifier
{
$$.i = $1.i | $2.i;
}
- | INVARIANT type_qualifier
+ | INVARIANT storage_qualifier
{
$$ = $2;
$$.q.invariant = 1;
}
+ | INVARIANT interpolation_qualifier storage_qualifier
+ {
+ $$.i = $2.i | $3.i;
+ $$.q.invariant = 1;
+ }
+ | INVARIANT
+ {
+ $$.i = 0;
+ $$.q.invariant = 1;
+ }
;
storage_qualifier:
CONST_TOK { $$.i = 0; $$.q.constant = 1; }
| ATTRIBUTE { $$.i = 0; $$.q.attribute = 1; }
- | opt_layout_qualifier VARYING { $$.i = $1.i; $$.q.varying = 1; }
+ | VARYING { $$.i = 0; $$.q.varying = 1; }
| CENTROID VARYING { $$.i = 0; $$.q.centroid = 1; $$.q.varying = 1; }
- | opt_layout_qualifier IN_TOK { $$.i = 0; $$.q.in = 1; }
+ | IN_TOK { $$.i = 0; $$.q.in = 1; }
| OUT_TOK { $$.i = 0; $$.q.out = 1; }
| CENTROID IN_TOK { $$.i = 0; $$.q.centroid = 1; $$.q.in = 1; }
| CENTROID OUT_TOK { $$.i = 0; $$.q.centroid = 1; $$.q.out = 1; }