[Mesa-dev] [PATCH V2 08/12] glsl: add process_qualifier_constant() helper

Timothy Arceri t_arceri at yahoo.com.au
Tue Nov 10 12:18:49 PST 2015


On Tue, 2015-11-10 at 12:33 +0000, Emil Velikov wrote:
> On 8 November 2015 at 22:34, Timothy Arceri <t_arceri at yahoo.com.au> wrote:
> > From: Timothy Arceri <timothy.arceri at collabora.com>
> > 
> > This helper is similar to the function added as part of the
> > ast_layout_expression class but will be used when only the
> > ast_expression type is required for the qualifier.
> > 
> > ast_expression is used if qualifier can't have mulitple declorations
> typo "multiple declarations"
> 
> > or if all but he newest qualifier is simply ignored.
> "the"
> 
> What is stopping us from introducing this helper first and then
> reusing it ? Currently we end up with exact same code twice.
> Also I'm struggling to see the function declaration - perhaps we
> should just annotate it as static ?

The difference is one processes ast_expression the other processes the new
 ast_layout_expression type, the reason for the difference is in how the
qualifiers are merged.

The ast_layout_expression type includes the addition of a list to keep track
of of multiple declarations for merging. Where ast_expression is used the
rules are different and we can just use the last declared qualifier and throw
away any previous one which makes processsing a little simpler.

I could make it so everything just uses the new ast_layout_expression type I
just wasn't sure what was the best way to do this, so sent the patches with
the two functions to see what people would think on review.

> 
> Thanks
> Emil


More information about the mesa-dev mailing list