[Piglit] [PATCH 3/8] arb_tessellation_shader: Add GL minmax test

Jordan Justen jordan.l.justen at intel.com
Mon Jun 2 15:44:04 PDT 2014


Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 tests/all.py                                       |  1 +
 tests/spec/CMakeLists.txt                          |  1 +
 .../spec/arb_tessellation_shader/CMakeLists.gl.txt | 15 ++++
 tests/spec/arb_tessellation_shader/CMakeLists.txt  |  1 +
 tests/spec/arb_tessellation_shader/minmax.c        | 94 ++++++++++++++++++++++
 5 files changed, 112 insertions(+)
 create mode 100644 tests/spec/arb_tessellation_shader/CMakeLists.gl.txt
 create mode 100644 tests/spec/arb_tessellation_shader/CMakeLists.txt
 create mode 100644 tests/spec/arb_tessellation_shader/minmax.c

diff --git a/tests/all.py b/tests/all.py
index 3d76da1..4972998 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -3179,6 +3179,7 @@ spec['ARB_compute_shader']['built-in constants'] = concurrent_test('built-in-con
 
 arb_tessellation_shader = {}
 spec['ARB_tessellation_shader'] = arb_tessellation_shader
+arb_tessellation_shader['minmax'] = concurrent_test('arb_tessellation_shader-minmax')
 spec['ARB_tessellation_shader']['built-in constants'] = concurrent_test('built-in-constants tests/spec/arb_tessellation_shader/minimum-maximums.txt')
 
 # group glslparsertest ------------------------------------------------------
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index 01100f9..489ff0c 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -41,6 +41,7 @@ add_subdirectory (arb_stencil_texturing)
 add_subdirectory (arb_sync)
 add_subdirectory (arb_uniform_buffer_object)
 add_subdirectory (ati_draw_buffers)
+add_subdirectory (arb_tessellation_shader)
 add_subdirectory (arb_texture_buffer_object)
 add_subdirectory (arb_texture_buffer_range)
 add_subdirectory (arb_texture_compression)
diff --git a/tests/spec/arb_tessellation_shader/CMakeLists.gl.txt b/tests/spec/arb_tessellation_shader/CMakeLists.gl.txt
new file mode 100644
index 0000000..a1e84ef
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/CMakeLists.gl.txt
@@ -0,0 +1,15 @@
+include_directories(
+	${GLEXT_INCLUDE_DIR}
+	${OPENGL_INCLUDE_PATH}
+	${piglit_SOURCE_DIR}/tests/util
+)
+
+link_libraries (
+	piglitutil_${piglit_target_api}
+	${OPENGL_gl_LIBRARY}
+	${OPENGL_glu_LIBRARY}
+)
+
+piglit_add_executable (arb_tesselation_shader-minmax minmax.c)
+
+# vim: ft=cmake:
diff --git a/tests/spec/arb_tessellation_shader/CMakeLists.txt b/tests/spec/arb_tessellation_shader/CMakeLists.txt
new file mode 100644
index 0000000..144a306
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_tessellation_shader/minmax.c b/tests/spec/arb_tessellation_shader/minmax.c
new file mode 100644
index 0000000..fded50e
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/minmax.c
@@ -0,0 +1,94 @@
+/*
+ * 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
+ *
+ * Test for the minimum maximum values specified in the
+ * ARB_tessellation_shader extension.
+ */
+
+#include "piglit-util-gl-common.h"
+#include "minmax-test.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+	config.supports_gl_compat_version = 32;
+	config.supports_gl_core_version = 32;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+#define GETINTV(x) glGetIntegerv(GL_ ## x, &x)
+
+enum piglit_result
+piglit_display(void)
+{
+	/* UNREACHED */
+	return PIGLIT_FAIL;
+}
+
+void
+piglit_init(int argc, char **argv)
+{
+	GLint MAX_TESS_CONTROL_UNIFORM_COMPONENTS;
+	GLint MAX_TESS_EVALUATION_UNIFORM_COMPONENTS;
+	GLint MAX_TESS_CONTROL_UNIFORM_BLOCKS;
+	GLint MAX_TESS_EVALUATION_UNIFORM_BLOCKS;
+	GLint MAX_UNIFORM_BLOCK_SIZE;
+
+	piglit_require_extension("GL_ARB_tessellation_shader");
+	piglit_print_minmax_header();
+
+	piglit_test_min_int(GL_MAX_TESS_GEN_LEVEL, 64);
+	piglit_test_min_int(GL_MAX_PATCH_VERTICES, 32);
+	piglit_test_min_int(GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS, 1024);
+	piglit_test_min_int(GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS, 1024);
+	piglit_test_min_int(GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS, 16);
+	piglit_test_min_int(GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS, 16);
+	piglit_test_min_int(GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS, 128);
+	piglit_test_min_int(GL_MAX_TESS_PATCH_COMPONENTS, 120);
+	piglit_test_min_int(GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS, 4096);
+	piglit_test_min_int(GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS, 128);
+	piglit_test_min_int(GL_MAX_TESS_CONTROL_INPUT_COMPONENTS, 128);
+	piglit_test_min_int(GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS, 128);
+	piglit_test_min_int(GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS, 12);
+	piglit_test_min_int(GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS, 12);
+
+	GETINTV(MAX_TESS_CONTROL_UNIFORM_COMPONENTS);
+	GETINTV(MAX_TESS_EVALUATION_UNIFORM_COMPONENTS);
+	GETINTV(MAX_TESS_CONTROL_UNIFORM_BLOCKS);
+	GETINTV(MAX_TESS_EVALUATION_UNIFORM_BLOCKS);
+	GETINTV(MAX_UNIFORM_BLOCK_SIZE);
+	piglit_test_min_int(GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS,
+			    MAX_TESS_CONTROL_UNIFORM_COMPONENTS +
+			    MAX_TESS_CONTROL_UNIFORM_BLOCKS * (MAX_UNIFORM_BLOCK_SIZE/4));
+	piglit_test_min_int(GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS,
+			    MAX_TESS_EVALUATION_UNIFORM_COMPONENTS +
+			    MAX_TESS_EVALUATION_UNIFORM_BLOCKS * (MAX_UNIFORM_BLOCK_SIZE/4));
+
+	piglit_test_min_int(GL_MAX_COMBINED_UNIFORM_BLOCKS, 60);
+	piglit_test_min_int(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, 80);
+
+	if (!piglit_check_gl_error(GL_NO_ERROR))
+		piglit_report_result(PIGLIT_FAIL);
+	piglit_report_result(piglit_minmax_pass ? PIGLIT_PASS : PIGLIT_FAIL);
+}
-- 
2.0.0.rc4



More information about the Piglit mailing list