[Mesa-dev] [PATCH v2 06/15] glsl parser: allow in & out for interface block members
Kenneth Graunke
kenneth at whitecape.org
Sat Mar 23 14:31:53 PDT 2013
On 03/22/2013 08:48 PM, Jordan Justen wrote:
> On Wed, Mar 20, 2013 at 5:32 PM, Eric Anholt <eric at anholt.net> wrote:
>> Jordan Justen <jordan.l.justen at intel.com> writes:
>>
>>> Previously uniform blocks allowed for the 'uniform' keyword
>>> to be used with members of a uniform blocks. With interface
>>> blocks 'in' can be used on 'in' interface block members and
>>> 'out' can be used on 'out' interface block members.
>>>
>>> The basic_interface_block rule will verify that the same
>>> qualifier type is used with the block and each member.
>>
>>> - type->qualifier = $1;
>>> - type->qualifier.flags.q.uniform = true;
>>> - type->specifier = $3;
>>> + if (!type->qualifier.merge_qualifier(& @1, state, $1)) {
>>> + YYERROR;
>>> + }
>>> +
>>> + if (type->qualifier.flags.q.attribute) {
>>> + _mesa_glsl_error(& @1, state,
>>> + "keyword 'attribute' cannot be used with "
>>> + "interface block member\n");
>>> + } else if (type->qualifier.flags.q.varying) {
>>> + _mesa_glsl_error(& @1, state,
>>> + "keyword 'varying' cannot be used with "
>>> + "interface block member\n");
>>> + }
>>
>> I think some more qualifiers are getting allowed now, are they all intentional?
>>
>> - invariant
>> - smooth
>> - flat
>> - noperspective
>
> Hmm. Yeah this seems off. I'll look into it.
Yeah, sounds like you don't want to use fully_specified_type here. You
could either
1. Change uniformopt into /* nothing */ | UNIFORM | IN_TOK | OUT_TOK, or
2. Create a new production similar to fully_specified_type that's
type_specifier
| UNIFORM type_specifier
| IN_TOK type_specifier
| OUT_TOK type_specifier
3. ...or think of something else :)
>> Could 7/15 get easily moved before this one, so that we don't allow
>> uniforms in our in/out blocks at this commit?
>
> Will do.
>
> Thanks!
>
> -Jordan
More information about the mesa-dev
mailing list