<div dir="ltr"><div>I don't think we have existing tests for RGTC that would work with GLES. (GLES doesn't have glGetTexImage, so the desktop GL tests can't be ported)</div><div><br></div><div>Marek<br></div><div><br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 28, 2018 at 8:40 PM Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu">imirkin@alum.mit.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">These are obviously a little barren ... the usual approach is to take<br>
existing tests and make them runnable in ES.<br>
<br>
At the very least, maybe add a test that glCompressedTexImage works<br>
with these too?<br>
On Wed, Nov 28, 2018 at 8:21 PM Marek Olšák <<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>> wrote:<br>
><br>
> From: Marek Olšák <<a href="mailto:marek.olsak@amd.com" target="_blank">marek.olsak@amd.com</a>><br>
><br>
> ---<br>
>  tests/opengl.py                               |  6 ++<br>
>  tests/spec/CMakeLists.txt                     |  2 +<br>
>  .../CMakeLists.gles2.txt                      |  7 ++<br>
>  .../CMakeLists.txt                            |  1 +<br>
>  .../ext_texture_compression_bptc/bptc-api.c   | 71 +++++++++++++++++++<br>
>  .../CMakeLists.gles2.txt                      |  7 ++<br>
>  .../CMakeLists.txt                            |  1 +<br>
>  .../ext_texture_compression_rgtc/rgtc-api.c   | 71 +++++++++++++++++++<br>
>  8 files changed, 166 insertions(+)<br>
>  create mode 100644 tests/spec/ext_texture_compression_bptc/CMakeLists.gles2.txt<br>
>  create mode 100644 tests/spec/ext_texture_compression_bptc/CMakeLists.txt<br>
>  create mode 100644 tests/spec/ext_texture_compression_bptc/bptc-api.c<br>
>  create mode 100644 tests/spec/ext_texture_compression_rgtc/CMakeLists.gles2.txt<br>
>  create mode 100644 tests/spec/ext_texture_compression_rgtc/CMakeLists.txt<br>
>  create mode 100644 tests/spec/ext_texture_compression_rgtc/rgtc-api.c<br>
><br>
> diff --git a/tests/opengl.py b/tests/opengl.py<br>
> index f2ddaa217..b2e5cf7fd 100644<br>
> --- a/tests/opengl.py<br>
> +++ b/tests/opengl.py<br>
> @@ -2647,20 +2647,25 @@ with profile.test_list.group_manager(<br>
>      g(['compressedteximage', 'GL_COMPRESSED_RGBA_BPTC_UNORM'])<br>
>      g(['compressedteximage', 'GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM'])<br>
>      g(['compressedteximage', 'GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT'])<br>
>      g(['compressedteximage', 'GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT'])<br>
>      g(['fbo-generatemipmap-formats', 'GL_ARB_texture_compression_bptc-unorm'],<br>
>        'fbo-generatemipmap-formats unorm')<br>
>      g(['fbo-generatemipmap-formats', 'GL_ARB_texture_compression_bptc-float'],<br>
>        'fbo-generatemipmap-formats float')<br>
>      add_texwrap_format_tests(g, 'GL_ARB_texture_compression_bptc')<br>
><br>
> +with profile.test_list.group_manager(<br>
> +        PiglitGLTest,<br>
> +        grouptools.join('spec', 'ext_texture_compression_bptc')) as g:<br>
> +    g(['bptc-api_gles2'])<br>
> +<br>
>  with profile.test_list.group_manager(<br>
>          PiglitGLTest,<br>
>          grouptools.join('spec', 'ext_vertex_array_bgra')) as g:<br>
>      g(['bgra-sec-color-pointer'], run_concurrent=False)<br>
>      g(['bgra-vert-attrib-pointer'], run_concurrent=False)<br>
><br>
>  with profile.test_list.group_manager(<br>
>          PiglitGLTest,<br>
>          grouptools.join('spec', 'apple_vertex_array_object')) as g:<br>
>      g(['vao-01'], run_concurrent=False)<br>
> @@ -3193,20 +3198,21 @@ with profile.test_list.group_manager(<br>
>      g(['compressedteximage', 'GL_COMPRESSED_SIGNED_RED_RGTC1_EXT'])<br>
>      g(['compressedteximage', 'GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT'])<br>
>      g(['arb_texture_compression-invalid-formats', 'rgtc'], 'invalid formats')<br>
>      g(['rgtc-teximage-01'], run_concurrent=False)<br>
>      g(['rgtc-teximage-02'], run_concurrent=False)<br>
>      g(['fbo-generatemipmap-formats', 'GL_EXT_texture_compression_rgtc'],<br>
>        'fbo-generatemipmap-formats')<br>
>      g(['fbo-generatemipmap-formats', 'GL_EXT_texture_compression_rgtc-signed'],<br>
>        'fbo-generatemipmap-formats-signed')<br>
>      add_texwrap_format_tests(g, 'GL_EXT_texture_compression_rgtc')<br>
> +    g(['rgtc-api_gles2'])<br>
><br>
>  with profile.test_list.group_manager(<br>
>          PiglitGLTest,<br>
>          grouptools.join('spec', 'ext_texture_compression_s3tc')) as g:<br>
>      g(['compressedteximage', 'GL_COMPRESSED_RGB_S3TC_DXT1_EXT'])<br>
>      g(['compressedteximage', 'GL_COMPRESSED_RGBA_S3TC_DXT1_EXT'])<br>
>      g(['compressedteximage', 'GL_COMPRESSED_RGBA_S3TC_DXT3_EXT'])<br>
>      g(['compressedteximage', 'GL_COMPRESSED_RGBA_S3TC_DXT5_EXT'])<br>
>      g(['arb_texture_compression-invalid-formats', 's3tc'], 'invalid formats')<br>
>      g(['gen-compressed-teximage'], run_concurrent=False)<br>
> diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt<br>
> index 4df9d331d..74edc5f24 100644<br>
> --- a/tests/spec/CMakeLists.txt<br>
> +++ b/tests/spec/CMakeLists.txt<br>
> @@ -177,10 +177,12 @@ add_subdirectory (ext_window_rectangles)<br>
>  add_subdirectory (arb_shader_texture_image_samples)<br>
>  add_subdirectory (arb_texture_barrier)<br>
>  add_subdirectory (intel_conservative_rasterization)<br>
>  add_subdirectory (arb_post_depth_coverage)<br>
>  add_subdirectory (arb_fragment_shader_interlock)<br>
>  add_subdirectory (ext_occlusion_query_boolean)<br>
>  add_subdirectory (ext_disjoint_timer_query)<br>
>  add_subdirectory (intel_blackhole_render)<br>
>  add_subdirectory (ext_texture_norm16)<br>
>  add_subdirectory (ext_render_snorm)<br>
> +add_subdirectory (ext_texture_compression_bptc)<br>
> +add_subdirectory (ext_texture_compression_rgtc)<br>
> diff --git a/tests/spec/ext_texture_compression_bptc/CMakeLists.gles2.txt b/tests/spec/ext_texture_compression_bptc/CMakeLists.gles2.txt<br>
> new file mode 100644<br>
> index 000000000..ce9d018b5<br>
> --- /dev/null<br>
> +++ b/tests/spec/ext_texture_compression_bptc/CMakeLists.gles2.txt<br>
> @@ -0,0 +1,7 @@<br>
> +link_libraries (<br>
> +       piglitutil_${piglit_target_api}<br>
> +)<br>
> +<br>
> +piglit_add_executable (bptc-api_gles2 bptc-api.c)<br>
> +<br>
> +# vim: ft=cmake:<br>
> diff --git a/tests/spec/ext_texture_compression_bptc/CMakeLists.txt b/tests/spec/ext_texture_compression_bptc/CMakeLists.txt<br>
> new file mode 100644<br>
> index 000000000..144a306f4<br>
> --- /dev/null<br>
> +++ b/tests/spec/ext_texture_compression_bptc/CMakeLists.txt<br>
> @@ -0,0 +1 @@<br>
> +piglit_include_target_api()<br>
> diff --git a/tests/spec/ext_texture_compression_bptc/bptc-api.c b/tests/spec/ext_texture_compression_bptc/bptc-api.c<br>
> new file mode 100644<br>
> index 000000000..8c5296992<br>
> --- /dev/null<br>
> +++ b/tests/spec/ext_texture_compression_bptc/bptc-api.c<br>
> @@ -0,0 +1,71 @@<br>
> +/*<br>
> + * Copyright © 2018 Advanced Micro Devices, Inc.<br>
> + *<br>
> + * Permission is hereby granted, free of charge, to any person obtaining a<br>
> + * copy of this software and associated documentation files (the "Software"),<br>
> + * to deal in the Software without restriction, including without limitation<br>
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
> + * and/or sell copies of the Software, and to permit persons to whom the<br>
> + * Software is furnished to do so, subject to the following conditions:<br>
> + *<br>
> + * The above copyright notice and this permission notice (including the next<br>
> + * paragraph) shall be included in all copies or substantial portions of the<br>
> + * Software.<br>
> + *<br>
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL<br>
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING<br>
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS<br>
> + * IN THE SOFTWARE.<br>
> + */<br>
> +<br>
> +#include "piglit-util-gl.h"<br>
> +<br>
> +PIGLIT_GL_TEST_CONFIG_BEGIN<br>
> +<br>
> +       config.supports_gl_es_version = 30;<br>
> +<br>
> +       config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;<br>
> +       config.khr_no_error_support = PIGLIT_NO_ERRORS;<br>
> +<br>
> +PIGLIT_GL_TEST_CONFIG_END<br>
> +<br>
> +void<br>
> +piglit_init(int argc, char **argv)<br>
> +{<br>
> +       piglit_require_extension("GL_EXT_texture_compression_bptc");<br>
> +<br>
> +       GLuint tex;<br>
> +       glGenTextures(1, &tex);<br>
> +       glBindTexture(GL_TEXTURE_2D, tex);<br>
> +<br>
> +       glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA_BPTC_UNORM_EXT,<br>
> +                    64, 64, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);<br>
> +       if (!piglit_check_gl_error(GL_NO_ERROR))<br>
> +               piglit_report_result(PIGLIT_FAIL);<br>
> +<br>
> +       glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT,<br>
> +                    64, 64, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);<br>
> +       if (!piglit_check_gl_error(GL_NO_ERROR))<br>
> +               piglit_report_result(PIGLIT_FAIL);<br>
> +<br>
> +       glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,<br>
> +                    64, 64, 0, GL_RGB, GL_FLOAT, NULL);<br>
> +       if (!piglit_check_gl_error(GL_NO_ERROR))<br>
> +               piglit_report_result(PIGLIT_FAIL);<br>
> +<br>
> +       glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,<br>
> +                    64, 64, 0, GL_RGB, GL_FLOAT, NULL);<br>
> +       if (!piglit_check_gl_error(GL_NO_ERROR))<br>
> +               piglit_report_result(PIGLIT_FAIL);<br>
> +<br>
> +       piglit_report_result(PIGLIT_PASS);<br>
> +}<br>
> +<br>
> +enum piglit_result<br>
> +piglit_display(void)<br>
> +{<br>
> +       return PIGLIT_FAIL;<br>
> +}<br>
> diff --git a/tests/spec/ext_texture_compression_rgtc/CMakeLists.gles2.txt b/tests/spec/ext_texture_compression_rgtc/CMakeLists.gles2.txt<br>
> new file mode 100644<br>
> index 000000000..a3a325401<br>
> --- /dev/null<br>
> +++ b/tests/spec/ext_texture_compression_rgtc/CMakeLists.gles2.txt<br>
> @@ -0,0 +1,7 @@<br>
> +link_libraries (<br>
> +       piglitutil_${piglit_target_api}<br>
> +)<br>
> +<br>
> +piglit_add_executable (rgtc-api_gles2 rgtc-api.c)<br>
> +<br>
> +# vim: ft=cmake:<br>
> diff --git a/tests/spec/ext_texture_compression_rgtc/CMakeLists.txt b/tests/spec/ext_texture_compression_rgtc/CMakeLists.txt<br>
> new file mode 100644<br>
> index 000000000..144a306f4<br>
> --- /dev/null<br>
> +++ b/tests/spec/ext_texture_compression_rgtc/CMakeLists.txt<br>
> @@ -0,0 +1 @@<br>
> +piglit_include_target_api()<br>
> diff --git a/tests/spec/ext_texture_compression_rgtc/rgtc-api.c b/tests/spec/ext_texture_compression_rgtc/rgtc-api.c<br>
> new file mode 100644<br>
> index 000000000..9d6087fc9<br>
> --- /dev/null<br>
> +++ b/tests/spec/ext_texture_compression_rgtc/rgtc-api.c<br>
> @@ -0,0 +1,71 @@<br>
> +/*<br>
> + * Copyright © 2018 Advanced Micro Devices, Inc.<br>
> + *<br>
> + * Permission is hereby granted, free of charge, to any person obtaining a<br>
> + * copy of this software and associated documentation files (the "Software"),<br>
> + * to deal in the Software without restriction, including without limitation<br>
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
> + * and/or sell copies of the Software, and to permit persons to whom the<br>
> + * Software is furnished to do so, subject to the following conditions:<br>
> + *<br>
> + * The above copyright notice and this permission notice (including the next<br>
> + * paragraph) shall be included in all copies or substantial portions of the<br>
> + * Software.<br>
> + *<br>
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL<br>
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING<br>
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS<br>
> + * IN THE SOFTWARE.<br>
> + */<br>
> +<br>
> +#include "piglit-util-gl.h"<br>
> +<br>
> +PIGLIT_GL_TEST_CONFIG_BEGIN<br>
> +<br>
> +       config.supports_gl_es_version = 30;<br>
> +<br>
> +       config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;<br>
> +       config.khr_no_error_support = PIGLIT_NO_ERRORS;<br>
> +<br>
> +PIGLIT_GL_TEST_CONFIG_END<br>
> +<br>
> +void<br>
> +piglit_init(int argc, char **argv)<br>
> +{<br>
> +       piglit_require_extension("GL_EXT_texture_compression_rgtc");<br>
> +<br>
> +       GLuint tex;<br>
> +       glGenTextures(1, &tex);<br>
> +       glBindTexture(GL_TEXTURE_2D, tex);<br>
> +<br>
> +       glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RED_RGTC1_EXT,<br>
> +                    64, 64, 0, GL_RED, GL_UNSIGNED_BYTE, NULL);<br>
> +       if (!piglit_check_gl_error(GL_NO_ERROR))<br>
> +               piglit_report_result(PIGLIT_FAIL);<br>
> +<br>
> +       glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_SIGNED_RED_RGTC1_EXT,<br>
> +                    64, 64, 0, GL_RED, GL_BYTE, NULL);<br>
> +       if (!piglit_check_gl_error(GL_NO_ERROR))<br>
> +               piglit_report_result(PIGLIT_FAIL);<br>
> +<br>
> +       glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RED_GREEN_RGTC2_EXT,<br>
> +                    64, 64, 0, GL_RG, GL_UNSIGNED_BYTE, NULL);<br>
> +       if (!piglit_check_gl_error(GL_NO_ERROR))<br>
> +               piglit_report_result(PIGLIT_FAIL);<br>
> +<br>
> +       glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,<br>
> +                    64, 64, 0, GL_RG, GL_BYTE, NULL);<br>
> +       if (!piglit_check_gl_error(GL_NO_ERROR))<br>
> +               piglit_report_result(PIGLIT_FAIL);<br>
> +<br>
> +       piglit_report_result(PIGLIT_PASS);<br>
> +}<br>
> +<br>
> +enum piglit_result<br>
> +piglit_display(void)<br>
> +{<br>
> +       return PIGLIT_FAIL;<br>
> +}<br>
> --<br>
> 2.17.1<br>
><br>
> _______________________________________________<br>
> Piglit mailing list<br>
> <a href="mailto:Piglit@lists.freedesktop.org" target="_blank">Piglit@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/piglit" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/piglit</a><br>
</blockquote></div></div></div>