[Mesa-dev] [PATCH] glsl: Allow invariant qualifer in block members in desktop OpenGL.

Timothy Arceri timothy.arceri at collabora.com
Thu Feb 11 12:26:06 UTC 2016


On Thu, 2016-02-11 at 11:38 +0100, Samuel Iglesias Gonsálvez wrote:
> On Thu, 2016-02-11 at 20:05 +1100, Timothy Arceri wrote:
> > On Thu, 2016-02-11 at 08:31 +0100, Samuel Iglesias Gonsálvez wrote:
> > > Feedback from Khronos is that 'invariant' should be allowed on
> > > block
> > > members for desktop OpenGL. Fix piglit regression added by
> > > fe1e89a0:
> > > invariant-qualifier-in-out-block-01.vert
> > > 
> > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89330
> > > Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
> > > ---
> > >  src/compiler/glsl/glsl_parser_extras.cpp | 9 +--------
> > >  1 file changed, 1 insertion(+), 8 deletions(-)
> > > 
> > > diff --git a/src/compiler/glsl/glsl_parser_extras.cpp
> > > b/src/compiler/glsl/glsl_parser_extras.cpp
> > > index 20ec89d..ebb4901 100644
> > > --- a/src/compiler/glsl/glsl_parser_extras.cpp
> > > +++ b/src/compiler/glsl/glsl_parser_extras.cpp
> > > @@ -955,15 +955,8 @@ _mesa_ast_process_interface_block(YYLTYPE
> > > *locp,
> > >         *
> > >         * "Only variables output from a shader can be candidates
> > > for
> > >         * invariance."
> > > -       *
> > > -       * From GLSL 4.40 and GLSL 1.50, section "Interface
> > > Blocks":
> > > -       *
> > > -       * "If optional qualifiers are used, they can include
> > > interpolation
> > > -       * qualifiers, auxiliary storage qualifiers, and storage
> > > qualifiers
> > > -       * and they must declare an input, output, or uniform
> > > member
> > > -       * consistent with the interface qualifier of the block"
> > >         */
> > > -      if (qualifier.flags.q.invariant)
> > > +      if (state->es_shader && qualifier.flags.q.invariant)
> > >           _mesa_glsl_error(locp, state,
> > >                            "invariant qualifiers cannot be used "
> > >                            "with interface blocks members");
> > 
> > Hi Samuel,
> > 
> > I didn't know (or forgot) we did block validation here, seem like
> > some
> > of the block specific stuff
> > in ast_process_struct_or_iface_block_members should be moved here,
> > I
> > might do that as a follow up patch. 
> > 
> > Anyway I think should be:
> > 
> > if (!(q.flags.q.in || q.flags.q.out ) &&
> > qualifier.flags.q.invariant)
> > 
> > so it will work with OES_shader_io_blocks right?
> > 
> 
> Right, good catch! I'll do the change locally... With that change, is
> it R-b you?

Yeah, with that it looks good to me.

Reviewed-by: Timothy Arceri <timothy.arceri at collabora.com>

> 
> Sam
> 
> > Tim


More information about the mesa-dev mailing list