[Mesa-dev] [PATCH] glsl: OpenGLES GLSL 3.1 precision qualifiers ordering rules

Jordan Justen jordan.l.justen at intel.com
Sat Oct 31 23:22:29 PDT 2015


On 2015-10-29 01:22:37, Iago Toral wrote:
> On Thu, 2015-10-29 at 00:47 -0700, Jordan Justen wrote:
> > The OpenGLES GLSL 3.1 specification uses the precision qualifier
> > ordering rules from ARB_shading_language_420pack.
> 
> Maybe expand the commit log to make explicit that this is for GLES 3.1
> and desktop GL since 4.2

has_420pack already checks for OpenGL 4.2, so for desktop GL, this
patch doesn't change anything.

I don't think we want to add OpenGLES 3.1 to has_420pack because the
3.1 spec doesn't appear to adopt all of 420pack.

-Jordan

> Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>
> 
> > Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> > ---
> >  src/glsl/glsl_parser.yy | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
> > index 2f2e10d..4636435 100644
> > --- a/src/glsl/glsl_parser.yy
> > +++ b/src/glsl/glsl_parser.yy
> > @@ -948,7 +948,8 @@ parameter_qualifier:
> >        if ($2.precision != ast_precision_none)
> >           _mesa_glsl_error(&@1, state, "duplicate precision qualifier");
> >  
> > -      if (!state->has_420pack() && $2.flags.i != 0)
> > +      if (!(state->has_420pack() || state->is_version(420, 310)) &&
> > +          $2.flags.i != 0)
> >           _mesa_glsl_error(&@1, state, "precision qualifiers must come last");
> >  
> >        $$ = $2;
> > @@ -1847,7 +1848,8 @@ type_qualifier:
> >        if ($2.precision != ast_precision_none)
> >           _mesa_glsl_error(&@1, state, "duplicate precision qualifier");
> >  
> > -      if (!state->has_420pack() && $2.flags.i != 0)
> > +      if (!(state->has_420pack() || state->is_version(420, 310)) &&
> > +          $2.flags.i != 0)
> >           _mesa_glsl_error(&@1, state, "precision qualifiers must come last");
> >  
> >        $$ = $2;
> 
> 


More information about the mesa-dev mailing list