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

Andres Gomez agomez at igalia.com
Mon Apr 25 14:03:12 UTC 2016


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



More information about the Piglit mailing list