[Piglit] [PATCH 3/3] apple_vertex_array_object: Add IsVertexArray() test

Matt Turner mattst88 at gmail.com
Thu Dec 20 19:45:51 PST 2012


---
 tests/all.tests                                    |    4 ++++
 tests/spec/arb_vertex_array_object/isvertexarray.c |   18 ++++++++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/tests/all.tests b/tests/all.tests
index 589c4cc..fd061f9 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -2636,6 +2636,10 @@ arb_vertex_array_object = Group()
 spec['ARB_vertex_array_object'] = arb_vertex_array_object
 arb_vertex_array_object['isvertexarray'] = concurrent_test('arb_vertex_array_object_isvertexarray')
 
+apple_vertex_array_object = Group()
+spec['APPLE_vertex_array_object'] = apple_vertex_array_object
+apple_vertex_array_object['isvertexarray'] = concurrent_test('arb_vertex_array_object_isvertexarray apple')
+
 oes_draw_texture = Group()
 spec['OES_draw_texture'] = oes_draw_texture
 oes_draw_texture['oes_draw_texture'] = concurrent_test('oes_draw_texture')
diff --git a/tests/spec/arb_vertex_array_object/isvertexarray.c b/tests/spec/arb_vertex_array_object/isvertexarray.c
index 8624ae4..35e8862 100644
--- a/tests/spec/arb_vertex_array_object/isvertexarray.c
+++ b/tests/spec/arb_vertex_array_object/isvertexarray.c
@@ -44,6 +44,8 @@
  *      GenVertexArrays with the command
  *
  *         void BindVertexArray(uint array);"
+ *
+ * The APPLE_vertex_array_object spec contains similar wording.
  */
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
@@ -66,9 +68,18 @@ void
 piglit_init(int argc, char **argv)
 {
 	GLuint id;
+	GLboolean apple;
+
+	if (argc == 2 && strcmp(argv[1], "apple") == 0) {
+		printf("apple\n");
+		apple = GL_TRUE;
+	}
 
 	piglit_require_gl_version(15);
-	piglit_require_extension("GL_ARB_vertex_array_object");
+	if (apple)
+		piglit_require_extension("GL_APPLE_vertex_array_object");
+	else
+		piglit_require_extension("GL_ARB_vertex_array_object");
 
 	glGenVertexArrays(1, &id);
 
@@ -77,7 +88,10 @@ piglit_init(int argc, char **argv)
 		piglit_report_result(PIGLIT_FAIL);
 	}
 
-	glBindVertexArray(id);
+	if (apple)
+		glBindVertexArrayAPPLE(id);
+	else
+		glBindVertexArray(id);
 
 	if (!glIsVertexArray(id)) {
 		fprintf(stderr, "id not recognized correctly as a vertex array object.\n");
-- 
1.7.8.6



More information about the Piglit mailing list