summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2018-11-28 18:38:52 -0500
committerMarek Olšák <marek.olsak@amd.com>2019-02-08 11:30:46 -0500
commit42aa5f3047ea7eb1eaa19fdfec3bd9b339fd8da3 (patch)
tree658f2f21cc7b12b0bb09ed3425eead32fcce5a7d
parentdebb6c02eb462aa71200053461a41093e50daca0 (diff)
Add new API tests for BPTC and RGTC GLES extensions (v2)
v2: add glCompressedTexImage2D tests
-rw-r--r--tests/opengl.py6
-rw-r--r--tests/spec/CMakeLists.txt2
-rw-r--r--tests/spec/ext_texture_compression_bptc/CMakeLists.gles2.txt7
-rw-r--r--tests/spec/ext_texture_compression_bptc/CMakeLists.txt1
-rw-r--r--tests/spec/ext_texture_compression_bptc/bptc-api.c91
-rw-r--r--tests/spec/ext_texture_compression_rgtc/CMakeLists.gles2.txt7
-rw-r--r--tests/spec/ext_texture_compression_rgtc/CMakeLists.txt1
-rw-r--r--tests/spec/ext_texture_compression_rgtc/rgtc-api.c91
8 files changed, 206 insertions, 0 deletions
diff --git a/tests/opengl.py b/tests/opengl.py
index 97dfbf984..b41317b7b 100644
--- a/tests/opengl.py
+++ b/tests/opengl.py
@@ -2657,6 +2657,11 @@ with profile.test_list.group_manager(
with profile.test_list.group_manager(
PiglitGLTest,
+ grouptools.join('spec', 'ext_texture_compression_bptc')) as g:
+ g(['bptc-api_gles2'])
+
+with profile.test_list.group_manager(
+ PiglitGLTest,
grouptools.join('spec', 'ext_vertex_array_bgra')) as g:
g(['bgra-sec-color-pointer'], run_concurrent=False)
g(['bgra-vert-attrib-pointer'], run_concurrent=False)
@@ -3200,6 +3205,7 @@ with profile.test_list.group_manager(
g(['fbo-generatemipmap-formats', 'GL_EXT_texture_compression_rgtc-signed'],
'fbo-generatemipmap-formats-signed')
add_texwrap_format_tests(g, 'GL_EXT_texture_compression_rgtc')
+ g(['rgtc-api_gles2'])
with profile.test_list.group_manager(
PiglitGLTest,
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index 4df9d331d..74edc5f24 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -184,3 +184,5 @@ add_subdirectory (ext_disjoint_timer_query)
add_subdirectory (intel_blackhole_render)
add_subdirectory (ext_texture_norm16)
add_subdirectory (ext_render_snorm)
+add_subdirectory (ext_texture_compression_bptc)
+add_subdirectory (ext_texture_compression_rgtc)
diff --git a/tests/spec/ext_texture_compression_bptc/CMakeLists.gles2.txt b/tests/spec/ext_texture_compression_bptc/CMakeLists.gles2.txt
new file mode 100644
index 000000000..ce9d018b5
--- /dev/null
+++ b/tests/spec/ext_texture_compression_bptc/CMakeLists.gles2.txt
@@ -0,0 +1,7 @@
+link_libraries (
+ piglitutil_${piglit_target_api}
+)
+
+piglit_add_executable (bptc-api_gles2 bptc-api.c)
+
+# vim: ft=cmake:
diff --git a/tests/spec/ext_texture_compression_bptc/CMakeLists.txt b/tests/spec/ext_texture_compression_bptc/CMakeLists.txt
new file mode 100644
index 000000000..144a306f4
--- /dev/null
+++ b/tests/spec/ext_texture_compression_bptc/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/ext_texture_compression_bptc/bptc-api.c b/tests/spec/ext_texture_compression_bptc/bptc-api.c
new file mode 100644
index 000000000..f8456cad6
--- /dev/null
+++ b/tests/spec/ext_texture_compression_bptc/bptc-api.c
@@ -0,0 +1,91 @@
+/*
+ * Copyright © 2018 Advanced Micro Devices, Inc.
+ *
+ * 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.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+ config.supports_gl_es_version = 30;
+
+ config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
+ config.khr_no_error_support = PIGLIT_NO_ERRORS;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+void
+piglit_init(int argc, char **argv)
+{
+ piglit_require_extension("GL_EXT_texture_compression_bptc");
+
+ GLuint tex;
+ glGenTextures(1, &tex);
+ glBindTexture(GL_TEXTURE_2D, tex);
+
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA_BPTC_UNORM_EXT,
+ 64, 64, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
+
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT,
+ 64, 64, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
+
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,
+ 64, 64, 0, GL_RGB, GL_FLOAT, NULL);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
+
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,
+ 64, 64, 0, GL_RGB, GL_FLOAT, NULL);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
+
+ glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA_BPTC_UNORM_EXT,
+ 64, 64, 0, 4096, NULL);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
+
+ glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT,
+ 64, 64, 0, 4096, NULL);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
+
+ glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,
+ 64, 64, 0, 4096, NULL);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
+
+ glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,
+ 64, 64, 0, 4096, NULL);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
+
+ piglit_report_result(PIGLIT_PASS);
+}
+
+enum piglit_result
+piglit_display(void)
+{
+ return PIGLIT_FAIL;
+}
diff --git a/tests/spec/ext_texture_compression_rgtc/CMakeLists.gles2.txt b/tests/spec/ext_texture_compression_rgtc/CMakeLists.gles2.txt
new file mode 100644
index 000000000..a3a325401
--- /dev/null
+++ b/tests/spec/ext_texture_compression_rgtc/CMakeLists.gles2.txt
@@ -0,0 +1,7 @@
+link_libraries (
+ piglitutil_${piglit_target_api}
+)
+
+piglit_add_executable (rgtc-api_gles2 rgtc-api.c)
+
+# vim: ft=cmake:
diff --git a/tests/spec/ext_texture_compression_rgtc/CMakeLists.txt b/tests/spec/ext_texture_compression_rgtc/CMakeLists.txt
new file mode 100644
index 000000000..144a306f4
--- /dev/null
+++ b/tests/spec/ext_texture_compression_rgtc/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/ext_texture_compression_rgtc/rgtc-api.c b/tests/spec/ext_texture_compression_rgtc/rgtc-api.c
new file mode 100644
index 000000000..fb43ea56f
--- /dev/null
+++ b/tests/spec/ext_texture_compression_rgtc/rgtc-api.c
@@ -0,0 +1,91 @@
+/*
+ * Copyright © 2018 Advanced Micro Devices, Inc.
+ *
+ * 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.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+ config.supports_gl_es_version = 30;
+
+ config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
+ config.khr_no_error_support = PIGLIT_NO_ERRORS;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+void
+piglit_init(int argc, char **argv)
+{
+ piglit_require_extension("GL_EXT_texture_compression_rgtc");
+
+ GLuint tex;
+ glGenTextures(1, &tex);
+ glBindTexture(GL_TEXTURE_2D, tex);
+
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RED_RGTC1_EXT,
+ 64, 64, 0, GL_RED, GL_UNSIGNED_BYTE, NULL);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
+
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_SIGNED_RED_RGTC1_EXT,
+ 64, 64, 0, GL_RED, GL_BYTE, NULL);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
+
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RED_GREEN_RGTC2_EXT,
+ 64, 64, 0, GL_RG, GL_UNSIGNED_BYTE, NULL);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
+
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,
+ 64, 64, 0, GL_RG, GL_BYTE, NULL);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
+
+ glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RED_RGTC1_EXT,
+ 64, 64, 0, 2048, NULL);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
+
+ glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_SIGNED_RED_RGTC1_EXT,
+ 64, 64, 0, 2048, NULL);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
+
+ glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RED_GREEN_RGTC2_EXT,
+ 64, 64, 0, 4096, NULL);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
+
+ glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,
+ 64, 64, 0, 4096, NULL);
+ if (!piglit_check_gl_error(GL_NO_ERROR))
+ piglit_report_result(PIGLIT_FAIL);
+
+ piglit_report_result(PIGLIT_PASS);
+}
+
+enum piglit_result
+piglit_display(void)
+{
+ return PIGLIT_FAIL;
+}