summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2013-07-15 10:50:35 -0700
committerKenneth Graunke <kenneth@whitecape.org>2013-07-18 16:57:22 -0700
commit83fe4f7019283851d56df14f47a5d5c01d6b6b9e (patch)
treeb8916f4e972cbbf0547d6680ea6a7d3a6aa94e54 /src/glsl
parent0cb90fcfbde5369f76c2e24b9fa2cbfc4f7557fc (diff)
downloadexternal_mesa3d-83fe4f7019283851d56df14f47a5d5c01d6b6b9e.zip
external_mesa3d-83fe4f7019283851d56df14f47a5d5c01d6b6b9e.tar.gz
external_mesa3d-83fe4f7019283851d56df14f47a5d5c01d6b6b9e.tar.bz2
glsl: Use merge_qualifier() when processing qualifier lists.
Most of ast_type_qualifier is simply a bitfield (represented as a structure of unsigned:1 bits in a union with an unsigned). However, it also contains ARB_explicit_attrib_location's location/index fields. In the past, this has worked by simply returning the layout qualifier's ast_type_qualifier and merging the other bits into it. However, that's not obvious until you break it by switching $1 and $2. Using merge_qualifier() copies them appropriately, and also properly overrides layout qualifiers. It also checks for duplicate qualifiers, which renders some of the checks in the previous patch unnecessary. However, those checks provide better error messages, such as "Duplicate interpolation qualifier", rather than just "duplicate qualifier". Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/glsl_parser.yy6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index 381fa2b..ffaf0f3 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -1375,7 +1375,7 @@ type_qualifier:
}
$$ = $1;
- $$.flags.i |= $2.flags.i;
+ $$.merge_qualifier(&@1, state, $2);
}
| layout_qualifier type_qualifier
{
@@ -1398,7 +1398,7 @@ type_qualifier:
}
$$ = $1;
- $$.flags.i |= $2.flags.i;
+ $$.merge_qualifier(&@1, state, $2);
}
| storage_qualifier type_qualifier
{
@@ -1416,7 +1416,7 @@ type_qualifier:
}
$$ = $1;
- $$.flags.i |= $2.flags.i;
+ $$.merge_qualifier(&@1, state, $2);
}
;