diff options
author | Matt Turner <mattst88@gmail.com> | 2012-12-20 13:04:11 -0800 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2012-12-20 13:06:39 -0800 |
commit | 92da9c3413dffa2e88d5e7518f15327f21577ab0 (patch) | |
tree | 359999f76cb5f53a41b54692da3a3bdccd817532 | |
parent | 741be9d4448a9f06b19e4491be324cc598e228fa (diff) |
arb_vertex_array_object: Add IsVertexArray() test
-rw-r--r-- | tests/all.tests | 4 | ||||
-rw-r--r-- | tests/spec/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/spec/arb_vertex_array_object/CMakeLists.gl.txt | 13 | ||||
-rw-r--r-- | tests/spec/arb_vertex_array_object/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/spec/arb_vertex_array_object/isvertexarray.c | 88 |
5 files changed, 107 insertions, 0 deletions
diff --git a/tests/all.tests b/tests/all.tests index 05af5720..589c4cce 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -2632,6 +2632,10 @@ ext_unpack_subimage = Group() spec['EXT_unpack_subimage'] = ext_unpack_subimage ext_unpack_subimage['basic'] = concurrent_test('ext_unpack_subimage') +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') + 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/CMakeLists.txt b/tests/spec/CMakeLists.txt index 1817c9ff..9ec37fa7 100644 --- a/tests/spec/CMakeLists.txt +++ b/tests/spec/CMakeLists.txt @@ -64,3 +64,4 @@ add_subdirectory (arb_draw_buffers) add_subdirectory (oes_draw_texture) add_subdirectory (arb_blend_func_extended) add_subdirectory (ext_unpack_subimage) +add_subdirectory (arb_vertex_array_object) diff --git a/tests/spec/arb_vertex_array_object/CMakeLists.gl.txt b/tests/spec/arb_vertex_array_object/CMakeLists.gl.txt new file mode 100644 index 00000000..836ac528 --- /dev/null +++ b/tests/spec/arb_vertex_array_object/CMakeLists.gl.txt @@ -0,0 +1,13 @@ +include_directories( + ${GLEXT_INCLUDE_DIR} + ${OPENGL_INCLUDE_PATH} +) + +link_libraries ( + piglitutil_${piglit_target_api} + ${OPENGL_gl_LIBRARY} +) + +piglit_add_executable (arb_vertex_array-isvertexarray isvertexarray.c) + +# vim: ft=cmake: diff --git a/tests/spec/arb_vertex_array_object/CMakeLists.txt b/tests/spec/arb_vertex_array_object/CMakeLists.txt new file mode 100644 index 00000000..144a306f --- /dev/null +++ b/tests/spec/arb_vertex_array_object/CMakeLists.txt @@ -0,0 +1 @@ +piglit_include_target_api() diff --git a/tests/spec/arb_vertex_array_object/isvertexarray.c b/tests/spec/arb_vertex_array_object/isvertexarray.c new file mode 100644 index 00000000..8624ae41 --- /dev/null +++ b/tests/spec/arb_vertex_array_object/isvertexarray.c @@ -0,0 +1,88 @@ +/* + * Copyright © 2012 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include "piglit-util-gl-common.h" + +/** + * @file isvertexarray.c + * + * Tests basic API support for glIsVertexArray(). + * + * From the ARB_vertex_array_object spec: + * + * "The command + * + * void GenVertexArrays(sizei n, uint *arrays); + * + * returns <n> previous unused vertex array object names in <arrays>. These + * names are marked as used, for the purposes of GenVertexArrays only, but + * they acquire array state only when they are first bound. + * + * [...] + * + * A vertex array object is created by binding a name returned by + * GenVertexArrays with the command + * + * void BindVertexArray(uint array);" + */ + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 10; + + config.window_width = 32; + config.window_height = 32; + +PIGLIT_GL_TEST_CONFIG_END + +enum piglit_result +piglit_display(void) +{ + /* UNREACHED */ + return PIGLIT_FAIL; +} + +void +piglit_init(int argc, char **argv) +{ + GLuint id; + + piglit_require_gl_version(15); + piglit_require_extension("GL_ARB_vertex_array_object"); + + glGenVertexArrays(1, &id); + + if (glIsVertexArray(id)) { + fprintf(stderr, "id recognized incorrectly as a vertex array object.\n"); + piglit_report_result(PIGLIT_FAIL); + } + + glBindVertexArray(id); + + if (!glIsVertexArray(id)) { + fprintf(stderr, "id not recognized correctly as a vertex array object.\n"); + piglit_report_result(PIGLIT_FAIL); + } + + piglit_report_result(PIGLIT_PASS); +} |