[Piglit] [PATCH] shader_runner: allow GL_MAX_VERTEX_ATTRIBS in requirements (v2)

Andres Gomez agomez at igalia.com
Fri Apr 29 12:20:06 UTC 2016


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 at 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



More information about the Piglit mailing list