[Piglit] [PATCH 1/4] GL_ARB_texture_buffer_object: Add a first test for the extension.

Eric Anholt eric at anholt.net
Wed Mar 7 18:10:02 PST 2012


---
 tests/all.tests                                    |    3 +
 tests/spec/CMakeLists.txt                          |    1 +
 .../arb_texture_buffer_object/CMakeLists.gl.txt    |   14 ++++
 .../spec/arb_texture_buffer_object/CMakeLists.txt  |    1 +
 tests/spec/arb_texture_buffer_object/minmax.c      |   71 ++++++++++++++++++++
 5 files changed, 90 insertions(+), 0 deletions(-)
 create mode 100644 tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt
 create mode 100644 tests/spec/arb_texture_buffer_object/CMakeLists.txt
 create mode 100644 tests/spec/arb_texture_buffer_object/minmax.c

diff --git a/tests/all.tests b/tests/all.tests
index 0539755..0c3a43d 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -1106,6 +1106,9 @@ add_plain_test(arb_explicit_attrib_location, 'glsl-explicit-location-03')
 add_plain_test(arb_explicit_attrib_location, 'glsl-explicit-location-04')
 add_plain_test(arb_explicit_attrib_location, 'glsl-explicit-location-05')
 
+arb_texture_buffer_object = Group()
+spec['ARB_texture_buffer_object'] = arb_texture_buffer_object
+arb_texture_buffer_object['minmax'] = concurrent_test('arb_texture_buffer_object-minmax')
 
 arb_texture_rectangle = Group()
 spec['ARB_texture_rectangle'] = arb_texture_rectangle
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index a807374..230bac0 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -13,6 +13,7 @@ add_subdirectory (amd_seamless_cubemap_per_texture)
 add_subdirectory (arb_shader_texture_lod/execution)
 add_subdirectory (arb_shader_objects)
 add_subdirectory (ati_draw_buffers)
+add_subdirectory (arb_texture_buffer_object)
 add_subdirectory (arb_texture_compression)
 add_subdirectory (arb_texture_float)
 add_subdirectory (arb_texture_storage)
diff --git a/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt b/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt
new file mode 100644
index 0000000..a0c5e02
--- /dev/null
+++ b/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt
@@ -0,0 +1,14 @@
+include_directories(
+	${OPENGL_INCLUDE_PATH}
+	${GLUT_INCLUDE_DIR}
+	${piglit_SOURCE_DIR}/tests/util
+)
+
+link_libraries (
+	piglitutil
+	${OPENGL_gl_LIBRARY}
+	${OPENGL_glu_LIBRARY}
+	${GLUT_glut_LIBRARY}
+)
+
+add_executable (arb_texture_buffer_object-minmax minmax.c)
diff --git a/tests/spec/arb_texture_buffer_object/CMakeLists.txt b/tests/spec/arb_texture_buffer_object/CMakeLists.txt
new file mode 100644
index 0000000..144a306
--- /dev/null
+++ b/tests/spec/arb_texture_buffer_object/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_texture_buffer_object/minmax.c b/tests/spec/arb_texture_buffer_object/minmax.c
new file mode 100644
index 0000000..36dd6b6
--- /dev/null
+++ b/tests/spec/arb_texture_buffer_object/minmax.c
@@ -0,0 +1,71 @@
+/* Copyright © 2011-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.
+ */
+
+/** @file minmax.c
+ *
+ * Test for the minimum maximum value in the GL_ARB_texture_buffer_object spec.
+ */
+
+#include "piglit-util.h"
+
+int piglit_width = 32;
+int piglit_height = 32;
+int piglit_window_mode = GLUT_DOUBLE | GLUT_RGB | GLUT_ALPHA;
+
+enum piglit_result
+piglit_display(void)
+{
+	/* UNREACHED */
+	return PIGLIT_FAIL;
+}
+
+static bool pass = true;
+
+static void
+min_test_i(GLenum token, GLint min, const char *name)
+{
+	GLint val = 0;
+
+	glGetIntegerv(token, &val);
+
+	if (val < min) {
+		fprintf(stderr, "%-50s %8d %8d (ERROR)\n",
+			name, min, val);
+		pass = false;
+	} else {
+		printf("%-50s %8d %8d\n", name, min, val);
+	}
+}
+
+#define MIN_INTEGER_TEST(token, min) min_test_i(token, min, #token)
+
+void
+piglit_init(int argc, char **argv)
+{
+	piglit_require_extension("GL_ARB_texture_buffer_object");
+
+	printf("%-50s %8s %8s\n", "token", "minimum", "value");
+
+	MIN_INTEGER_TEST(GL_MAX_TEXTURE_BUFFER_SIZE, 65536);
+
+	piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
+}
-- 
1.7.9.1



More information about the Piglit mailing list