[Piglit] [PATCH] shader_runner: allow GL_MAX_VERTEX_ATTRIBS in requirements

Andres Gomez agomez at igalia.com
Fri Apr 29 12:15:59 UTC 2016


On Tue, 2016-04-26 at 11:00 +0200, Marek Olšák wrote:
> On Mon, Apr 25, 2016 at 4:03 PM, Andres Gomez <agomez at igalia.com>
> wrote:
> > 
> > Signed-off-by: Andres Gomez <agomez at igalia.com>
> > ---
> >  tests/shaders/shader_runner.c | 17 ++++++++++++++++-
> >  1 file changed, 16 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tests/shaders/shader_runner.c
> > b/tests/shaders/shader_runner.c
> > index 239735c..2f6bec8 100644
> > --- a/tests/shaders/shader_runner.c
> > +++ b/tests/shaders/shader_runner.c
> > @@ -89,6 +89,7 @@ static struct component_version glsl_req_version;
> >  static int gl_max_vertex_output_components;
> >  static int gl_max_fragment_uniform_components;
> >  static int gl_max_vertex_uniform_components;
> > +static int gl_max_vertex_attribs;
> >  static int gl_max_varying_components;
> >  static int gl_max_clip_planes;
> > 
> > @@ -724,6 +725,11 @@ process_requirement(const char *line)
> >                         "vertex uniform components",
> >                 },
> >                 {
> > +                       "GL_MAX_VERTEX_ATTRIBS",
> > +                       &gl_max_vertex_attribs,
> > +                       "vertex attribs",
> > +               },
> > +               {
> >                         "GL_MAX_VARYING_COMPONENTS",
> >                         &gl_max_varying_components,
> >                         "varying components",
> > @@ -3323,9 +3329,12 @@ piglit_init(int argc, char **argv)
> >                 glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS,
> >                               &gl_max_fragment_uniform_components);
> >         if (piglit_get_gl_version() >= 20 ||
> > -           piglit_is_extension_supported("GL_ARB_vertex_shader"))
> > +           piglit_is_extension_supported("GL_ARB_vertex_shader"))
> > {
> >                 glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS,
> >                               &gl_max_vertex_uniform_components);
> > +               glGetIntegerv(GL_MAX_VERTEX_ATTRIBS,
> > +                             &gl_max_vertex_attribs);
> > +       }
> >         if (piglit_get_gl_version() >= 30 ||
> >             piglit_is_extension_supported("GL_ARB_geometry_shader4"
> > ) ||
> >             piglit_is_extension_supported("GL_EXT_geometry_shader4"
> > ))
> > @@ -3346,6 +3355,12 @@ piglit_init(int argc, char **argv)
> >         gl_max_vertex_uniform_components *= 4;
> >         gl_max_varying_components *= 4;
> >         gl_max_clip_planes = 0;
> > +#if defined(PIGLIT_USE_OPENGL_ES3) ||
> > defined(PIGLIT_USE_OPENGL_ES2)
> > +       glGetIntegerv(GL_MAX_VERTEX_ATTRIBS,
> > +                     &gl_max_vertex_attribs);
> > +#else
> > +       gl_max_vertex_attribs = 16;
> This seems to override the first query above. Is that intentional?
> 
> Marek

Argh, you are right. I've done something more complicated and error
prone than needed.

Let's just use the query if GL >= 20 or the extension supported and be
done with that.

I'll send a v2 version.

Thanks!

> 
> > 
> > +#endif
> >  #endif
> >         if (argc < 2) {
> >                 printf("usage: shader_runner
> > <test.shader_test>\n");
> > --
> > 2.8.0.rc3
> > 
> > _______________________________________________
> > Piglit mailing list
> > Piglit at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/piglit
-- 
Andres Gomez
Computer Science Engineer
mailto:agomez at igalia.com
http://blogs.igalia.com/agomez/category/igaliacom/
IGALIA, S.L. http://www.igalia.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20160429/f9aaf934/attachment.sig>


More information about the Piglit mailing list