[Piglit] [PATCH 6/7] arb_gpu_shader5: add minmax test

Jordan Justen jordan.l.justen at intel.com
Thu Jan 23 23:55:11 PST 2014


Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 tests/spec/CMakeLists.txt                    |  1 +
 tests/spec/arb_gpu_shader5/CMakeLists.gl.txt | 12 ++++++
 tests/spec/arb_gpu_shader5/CMakeLists.txt    |  1 +
 tests/spec/arb_gpu_shader5/minmax.c          | 64 ++++++++++++++++++++++++++++
 4 files changed, 78 insertions(+)
 create mode 100644 tests/spec/arb_gpu_shader5/CMakeLists.gl.txt
 create mode 100644 tests/spec/arb_gpu_shader5/CMakeLists.txt
 create mode 100644 tests/spec/arb_gpu_shader5/minmax.c

diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index d49872a..8a8ec90 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -11,6 +11,7 @@ add_subdirectory (arb_framebuffer_object)
 add_subdirectory (arb_framebuffer_srgb)
 add_subdirectory (arb_geometry_shader4)
 add_subdirectory (arb_get_program_binary)
+add_subdirectory (arb_gpu_shader5)
 add_subdirectory (arb_instanced_arrays)
 add_subdirectory (arb_internalformat_query)
 add_subdirectory (arb_map_buffer_alignment)
diff --git a/tests/spec/arb_gpu_shader5/CMakeLists.gl.txt b/tests/spec/arb_gpu_shader5/CMakeLists.gl.txt
new file mode 100644
index 0000000..74c5375
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/CMakeLists.gl.txt
@@ -0,0 +1,12 @@
+include_directories(
+	${GLEXT_INCLUDE_DIR}
+	${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+	piglitutil_${piglit_target_api}
+	${OPENGL_gl_LIBRARY}
+	${OPENGL_glu_LIBRARY}
+)
+
+piglit_add_executable (arb_gpu_shader5-minmax minmax.c)
diff --git a/tests/spec/arb_gpu_shader5/CMakeLists.txt b/tests/spec/arb_gpu_shader5/CMakeLists.txt
new file mode 100644
index 0000000..4a012b9
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
\ No newline at end of file
diff --git a/tests/spec/arb_gpu_shader5/minmax.c b/tests/spec/arb_gpu_shader5/minmax.c
new file mode 100644
index 0000000..a50412b
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/minmax.c
@@ -0,0 +1,64 @@
+/* Copyright (c) 2014 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 values in GL_ARB_gpu_shader5.
+ */
+
+#include "piglit-util-gl-common.h"
+#include "minmax-test.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+	config.supports_gl_core_version = 32;
+	config.supports_gl_compat_version = 32;
+
+	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+enum piglit_result
+piglit_display(void)
+{
+	/* UNREACHED */
+	return PIGLIT_FAIL;
+}
+
+void
+piglit_init(int argc, char **argv)
+{
+	piglit_print_minmax_header();
+
+	piglit_require_extension("GL_ARB_gpu_shader5");
+
+	piglit_test_min_int(GL_MAX_GEOMETRY_SHADER_INVOCATIONS, 32);
+	piglit_test_max_float(GL_MIN_FRAGMENT_INTERPOLATION_OFFSET, -0.5);
+	piglit_test_min_float(GL_MAX_FRAGMENT_INTERPOLATION_OFFSET, 0.5);
+	piglit_test_min_int(GL_FRAGMENT_INTERPOLATION_OFFSET_BITS, 4);
+	piglit_test_min_int(GL_MAX_VERTEX_STREAMS, 4);
+
+	if (!piglit_check_gl_error(GL_NO_ERROR))
+		piglit_report_result(PIGLIT_FAIL);
+
+	piglit_report_result(piglit_minmax_pass ? PIGLIT_PASS : PIGLIT_FAIL);
+}
-- 
1.8.5.3



More information about the Piglit mailing list