mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 14:40:10 +01:00
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:
<precision: mediump>
Then the storage_qualifier rule creates a second one:
<flags: in>
and calls merge_qualifier() to fold in any previous qualifications,
returning:
<flags: in, precision: mediump>
Finally, the auxiliary_storage_qualifier creates one for "centroid":
<flags: centroid>
it then does $$ = $1 and $$.flags |= $2.flags, resulting in:
<flags: centroid, 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 <kenneth@whitecape.org>
Reported-by: Kevin Rogovin <kevin.rogovin@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 2062f40d81)
This commit is contained in:
parent
490b810d0e
commit
e91dd3661c
1 changed files with 1 additions and 1 deletions
|
|
@ -1530,7 +1530,7 @@ type_qualifier:
|
|||
"just before storage qualifiers");
|
||||
}
|
||||
$$ = $1;
|
||||
$$.flags.i |= $2.flags.i;
|
||||
$$.merge_qualifier(&@1, state, $2);
|
||||
}
|
||||
| storage_qualifier type_qualifier
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue