[Mesa-dev] [PATCH 04/13] glsl: Split default in layout qualifier merge

Timothy Arceri timothy.arceri at collabora.com
Tue Nov 22 10:54:53 UTC 2016


On Mon, 2016-11-21 at 18:08 +0200, Andres Gomez wrote:
> On Thu, 2016-11-17 at 16:56 +1100, Timothy Arceri wrote:
> > 
> > On Mon, 2016-11-14 at 19:15 +0200, Andres Gomez wrote:
> ... 
> > 
> > > 
> > > diff --git a/src/compiler/glsl/glsl_parser.yy
> > > b/src/compiler/glsl/glsl_parser.yy
> > > index 50f7097..9f18c15 100644
> > > --- a/src/compiler/glsl/glsl_parser.yy
> > > +++ b/src/compiler/glsl/glsl_parser.yy
> > > @@ -2913,8 +2913,10 @@ layout_in_defaults:
> > >           _mesa_glsl_error(&@1, state, "duplicate layout(...)
> > > qualifiers");
> > >           YYERROR;
> > >        } else {
> > > -         if (!state->in_qualifier->
> > > -                merge_in_qualifier(& @1, state, $1, $$, false))
> > > {
> > > +         if (!$1.validate_in_qualifier(& @1, state)) {
> > > +            YYERROR;
> > > +         }
> > > +         if (!$1.merge_into_in_qualifier(& @1, state, $$,
> > > false)) {
> > >              YYERROR;
> > >           }
> > 
> > 
> > To avoid regressions between patches the order should be merge then
> > validate right?
> 
> No, the original code does first the validation and then the merge.
> 
> This swaps when the merging behavior changes, merging the default in
> qualifier as the last step in patch 08/13. Then, we first merge and
> afterwards validate on the resulting layout-qualifier.
> 

Yes. But in this patch aren't you changing the validation to check the
current (already merged) layout rather than the new layout so you need
to switch the order the original code does validation right?


More information about the mesa-dev mailing list