shader_runner: allow GL_MAX_VERTEX_ATTRIBS in requirements

Submitted by Andres Gomez on April 25, 2016, 2:03 p.m.

Details

Message ID 1461592992-32136-1-git-send-email-agomez@igalia.com
State Superseded
Headers show
Series "shader_runner: allow GL_MAX_VERTEX_ATTRIBS in requirements" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Andres Gomez April 25, 2016, 2:03 p.m.
Signed-off-by: Andres Gomez <agomez@igalia.com>
---
 tests/shaders/shader_runner.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

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;
+#endif
 #endif
 	if (argc < 2) {
 		printf("usage: shader_runner <test.shader_test>\n");

Comments

On Mon, Apr 25, 2016 at 4:03 PM, Andres Gomez <agomez@igalia.com> wrote:
> Signed-off-by: Andres Gomez <agomez@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

> +#endif
>  #endif
>         if (argc < 2) {
>                 printf("usage: shader_runner <test.shader_test>\n");
> --
> 2.8.0.rc3
>
> _______________________________________________
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
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@igalia.com>
> wrote:
> > 
> > Signed-off-by: Andres Gomez <agomez@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@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/piglit