From: Kenneth Graunke Date: Thu, 6 Feb 2014 05:42:00 +0000 (-0800) Subject: glsl: Don't lose precision qualifiers when encountering "centroid". X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2062f40d81de4743758851b03dad506f9cb6f306;p=mesa.git glsl: Don't lose precision qualifiers when encountering "centroid". Mesa fails to retain the precision qualifier when parsing: #version 300 es centroid in mediump vec2 v; Consider how the parser's type_qualifier production is applied. First, the precision_qualifier rule creates a new ast_type_qualifier: Then the storage_qualifier rule creates a second one: and calls merge_qualifier() to fold in any previous qualifications, returning: Finally, the auxiliary_storage_qualifier creates one for "centroid": it then does $$ = $1 and $$.flags |= $2.flags, resulting in: Since precision isn't stored in the flags bitfield, it is lost. We need to instead call merge_qualifier to combine all the fields. Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke Reported-by: Kevin Rogovin Reviewed-by: Matt Turner Reviewed-by: Ian Romanick --- diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy index b26c2030fe1..dc35c1a51b3 100644 --- a/src/glsl/glsl_parser.yy +++ b/src/glsl/glsl_parser.yy @@ -1494,7 +1494,7 @@ type_qualifier: "just before storage qualifiers"); } $$ = $1; - $$.flags.i |= $2.flags.i; + $$.merge_qualifier(&@1, state, $2); } | storage_qualifier type_qualifier {