shader_runner: allow GL_MAX_VERTEX_ATTRIBS in requirements (v2)

Submitted by Andres Gomez on April 29, 2016, 12:20 p.m.

Details

Message ID 1461932406-16829-1-git-send-email-agomez@igalia.com
State Accepted
Commit 9d8a7794202aec811bca40c451b894ce7b84706a
Headers show
Series "shader_runner: allow GL_MAX_VERTEX_ATTRIBS in requirements" ( rev: 2 ) in Piglit

Not browsing as part of any series.

Commit Message

Andres Gomez April 29, 2016, 12:20 p.m.
v2: Just use the same query for GL or GLS 2.0 and 3.0 as noted by
    Marek Olšák.

Signed-off-by: Andres Gomez <agomez@igalia.com>
---
 tests/shaders/shader_runner.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Patch hide | download patch | download mbox

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index f0b2ed3..233c600 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -90,6 +90,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;
 
@@ -725,6 +726,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",
@@ -3322,6 +3328,13 @@  piglit_init(int argc, char **argv)
 	gl_max_varying_components *= 4;
 	gl_max_clip_planes = 0;
 #endif
+	if (gl_version.num >= 20 ||
+	    piglit_is_extension_supported("GL_ARB_vertex_shader"))
+		glGetIntegerv(GL_MAX_VERTEX_ATTRIBS,
+			      &gl_max_vertex_attribs);
+	else
+		gl_max_vertex_attribs = 16;
+
 	if (argc < 2) {
 		printf("usage: shader_runner <test.shader_test>\n");
 		exit(1);

Comments

Reviewed-by: Marek Olšák <marek.olsak@amd.com>

Marek

On Fri, Apr 29, 2016 at 2:20 PM, Andres Gomez <agomez@igalia.com> wrote:
> v2: Just use the same query for GL or GLS 2.0 and 3.0 as noted by
>     Marek Olšák.
>
> Signed-off-by: Andres Gomez <agomez@igalia.com>
> ---
>  tests/shaders/shader_runner.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index f0b2ed3..233c600 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -90,6 +90,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;
>
> @@ -725,6 +726,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",
> @@ -3322,6 +3328,13 @@ piglit_init(int argc, char **argv)
>         gl_max_varying_components *= 4;
>         gl_max_clip_planes = 0;
>  #endif
> +       if (gl_version.num >= 20 ||
> +           piglit_is_extension_supported("GL_ARB_vertex_shader"))
> +               glGetIntegerv(GL_MAX_VERTEX_ATTRIBS,
> +                             &gl_max_vertex_attribs);
> +       else
> +               gl_max_vertex_attribs = 16;
> +
>         if (argc < 2) {
>                 printf("usage: shader_runner <test.shader_test>\n");
>                 exit(1);
> --
> 2.8.0.rc3
>