Re: [Piglit] [PATCH v2 4/4] Add API tests for KHR_texture_compression_astc_ldr
On Mon 14 Sep 2015, Nanley Chery wrote: > On Tue, Sep 8, 2015 at 11:45 AM, Chad Versace> wrote: > > > On Fri 28 Aug 2015, Nanley Chery wrote: > > > From: Nanley Chery > > > > > > These tests check that the GL error returned by valid and invalid API > > calls > > > are as defined by the spec. > > > > > > Signed-off-by: Nanley Chery > > > --- > > > .../khr_texture_compression_astc/CMakeLists.gl.txt | 1 + > > > .../CMakeLists.gles2.txt | 1 + > > > .../khr_compressed_astc-basic.c| 366 > > + > > > 3 files changed, 368 insertions(+) > > > create mode 100644 > > tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c > > > +static const GLenum good_targets[] = { > > > > There are additional good targets: 3D and and CUBE_MAP. Please rename > > this variable to indicate that these are "good targets" for > > glCompressedTex*3D(). > > > I'm not sure what you mean by additional good targets. I've renamed the > variable to good_compressed_tex_3d_targets. > > > > + GL_TEXTURE_2D_ARRAY, > > > + GL_TEXTURE_CUBE_MAP_ARRAY_EXT, > > > + GL_TEXTURE_3D, > > > +}; I typo'd. I meant *2D* (not 3D) and CUBE_MAP are additional good targets for ASTC. Those targets are good for glCompressedTex*2D(). In other words, I meanth that this array isn't a list of *all* good ASTC targets, because it excludes 2D and CUBE_MAP. > > > + /* Test CompressedTexImage3D */ > > > + glCompressedTexImage3D(GL_TEXTURE_CUBE_MAP_ARRAY_EXT, 0, > > > + formats[fi].fmt, 4, 3, 6, 0, 6*formats[fi].bb, > > fake_tex_data); > > > + REQUIRE_ERROR(GL_INVALID_VALUE); > > > > If HDR is unsupported, I think glCompressedTexImage3D is allowed to > > emit GL_INVALID_OPERATION here. So, I think glCompressedTexImage3D() > > should be tested on non-square dimensions only if HDR is supported. > > > Agreed. I just made a patch for mesa to support this behavior. I'm > thinking it'd be better to check that for GL_INVALID_OPERATION if HDR is > not supported, and GL_INVALID_VALUE otherwise. Sounds good to me. ... Also, the reply-level was corrupted in your message. Maybe your email program is configured incorrectly? Perhaps its a word-wrap problem? The bug was that the first line of each of your responses was at reply-level=1 instead of reply-level=0. That rendered your single-line responses, nearly invisible, since the single line looked like it belonged to my message instead of yours. ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH v2 4/4] Add API tests for KHR_texture_compression_astc_ldr
On Tue, Sep 8, 2015 at 11:45 AM, Chad Versacewrote: > On Fri 28 Aug 2015, Nanley Chery wrote: > > From: Nanley Chery > > > > These tests check that the GL error returned by valid and invalid API > calls > > are as defined by the spec. > > > > Signed-off-by: Nanley Chery > > --- > > .../khr_texture_compression_astc/CMakeLists.gl.txt | 1 + > > .../CMakeLists.gles2.txt | 1 + > > .../khr_compressed_astc-basic.c| 366 > + > > 3 files changed, 368 insertions(+) > > create mode 100644 > tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c > > > > diff --git a/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt > b/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt > > index a47c7d3..79500f7 100644 > > --- a/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt > > +++ b/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt > > @@ -10,5 +10,6 @@ link_libraries ( > > ) > > > > piglit_add_executable(khr_compressed_astc-miptree_${piglit_target_api} > khr_compressed_astc-miptree.c) > > +piglit_add_executable(khr_compressed_astc-basic_${piglit_target_api} > khr_compressed_astc-basic.c) > > > > # vim: ft=cmake: > > diff --git > a/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt > b/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt > > index 047b8ac..3fb6fa5 100644 > > --- a/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt > > +++ b/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt > > @@ -4,5 +4,6 @@ include_directories( > > ) > > link_libraries(piglitutil_${piglit_target_api}) > > piglit_add_executable(khr_compressed_astc-miptree_${piglit_target_api} > khr_compressed_astc-miptree.c) > > +piglit_add_executable(khr_compressed_astc-basic_${piglit_target_api} > khr_compressed_astc-basic.c) > > > > # vim: ft=cmake: > > diff --git > a/tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c > b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c > > new file mode 100644 > > index 000..d83ad5e > > --- /dev/null > > +++ b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c > > @@ -0,0 +1,366 @@ > > > +#include "piglit-util-gl.h" > > + > > +static const GLenum cube_map_face_targets[] = { > > + GL_TEXTURE_CUBE_MAP_POSITIVE_X, > > + GL_TEXTURE_CUBE_MAP_NEGATIVE_X, > > + GL_TEXTURE_CUBE_MAP_POSITIVE_Y, > > + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, > > + GL_TEXTURE_CUBE_MAP_POSITIVE_Z, > > + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z > > +}; > > + > > +static const GLenum good_targets[] = { > > There are additional good targets: 3D and and CUBE_MAP. Please rename > this variable to indicate that these are "good targets" for > glCompressedTex*3D(). > > I'm not sure what you mean by additional good targets. I've renamed the variable to good_compressed_tex_3d_targets. > > + GL_TEXTURE_2D_ARRAY, > > + GL_TEXTURE_CUBE_MAP_ARRAY_EXT, > > + GL_TEXTURE_3D, > > +}; > > + > > +typedef struct _astc_fmt { > > + GLenum fmt; > > + int bw; > > + int bh; > > + int bb; > > +} astc_fmt; > > Since the underscored struct tag is nowhere used, you should remove it. > > Please add a one-line comment for each of the astc_fmt fields. > > Fixed these two. > > + > > +static const astc_fmt formats[] = { > > +{GL_COMPRESSED_RGBA_ASTC_4x4_KHR , 4, 4, 16}, > > +{GL_COMPRESSED_RGBA_ASTC_5x4_KHR , 5, 4, 16}, > > +{GL_COMPRESSED_RGBA_ASTC_5x5_KHR , 5, 5, 16}, > > +{GL_COMPRESSED_RGBA_ASTC_6x5_KHR , 6, 5, 16}, > > +{GL_COMPRESSED_RGBA_ASTC_6x6_KHR , 6, 6, 16}, > > +{GL_COMPRESSED_RGBA_ASTC_8x5_KHR , 8, 5, 16}, > > +{GL_COMPRESSED_RGBA_ASTC_8x6_KHR , 8, 6, 16}, > > +{GL_COMPRESSED_RGBA_ASTC_8x8_KHR , 8, 8, 16}, > > +{GL_COMPRESSED_RGBA_ASTC_10x5_KHR , 10, 5, 16}, > > +{GL_COMPRESSED_RGBA_ASTC_10x6_KHR , 10, 6, 16}, > > +{GL_COMPRESSED_RGBA_ASTC_10x8_KHR , 10, 8, 16}, > > +{GL_COMPRESSED_RGBA_ASTC_10x10_KHR, 10, 10, 16}, > > +{GL_COMPRESSED_RGBA_ASTC_12x10_KHR, 12, 10, 16}, > > +{GL_COMPRESSED_RGBA_ASTC_12x12_KHR, 12, 12, 16}, > > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR , 4, 4, 16}, > > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR , 5, 4, 16}, > > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR , 5, 5, 16}, > > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR , 6, 5, 16}, > > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR , 6, 6, 16}, > > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR , 8, 5, 16}, > > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR , 8, 6, 16}, > > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR , 8, 8, 16}, > > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR , 10, 5, 16}, > > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR , 10, 6, 16},
Re: [Piglit] [PATCH v2 4/4] Add API tests for KHR_texture_compression_astc_ldr
On Fri 28 Aug 2015, Nanley Chery wrote: > From: Nanley Chery> > These tests check that the GL error returned by valid and invalid API calls > are as defined by the spec. > > Signed-off-by: Nanley Chery > --- > .../khr_texture_compression_astc/CMakeLists.gl.txt | 1 + > .../CMakeLists.gles2.txt | 1 + > .../khr_compressed_astc-basic.c| 366 > + > 3 files changed, 368 insertions(+) > create mode 100644 > tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c > > diff --git a/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt > b/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt > index a47c7d3..79500f7 100644 > --- a/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt > +++ b/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt > @@ -10,5 +10,6 @@ link_libraries ( > ) > > piglit_add_executable(khr_compressed_astc-miptree_${piglit_target_api} > khr_compressed_astc-miptree.c) > +piglit_add_executable(khr_compressed_astc-basic_${piglit_target_api} > khr_compressed_astc-basic.c) > > # vim: ft=cmake: > diff --git a/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt > b/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt > index 047b8ac..3fb6fa5 100644 > --- a/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt > +++ b/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt > @@ -4,5 +4,6 @@ include_directories( > ) > link_libraries(piglitutil_${piglit_target_api}) > piglit_add_executable(khr_compressed_astc-miptree_${piglit_target_api} > khr_compressed_astc-miptree.c) > +piglit_add_executable(khr_compressed_astc-basic_${piglit_target_api} > khr_compressed_astc-basic.c) > > # vim: ft=cmake: > diff --git > a/tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c > b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c > new file mode 100644 > index 000..d83ad5e > --- /dev/null > +++ b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c > @@ -0,0 +1,366 @@ > +#include "piglit-util-gl.h" > + > +static const GLenum cube_map_face_targets[] = { > + GL_TEXTURE_CUBE_MAP_POSITIVE_X, > + GL_TEXTURE_CUBE_MAP_NEGATIVE_X, > + GL_TEXTURE_CUBE_MAP_POSITIVE_Y, > + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, > + GL_TEXTURE_CUBE_MAP_POSITIVE_Z, > + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z > +}; > + > +static const GLenum good_targets[] = { There are additional good targets: 3D and and CUBE_MAP. Please rename this variable to indicate that these are "good targets" for glCompressedTex*3D(). > + GL_TEXTURE_2D_ARRAY, > + GL_TEXTURE_CUBE_MAP_ARRAY_EXT, > + GL_TEXTURE_3D, > +}; > + > +typedef struct _astc_fmt { > + GLenum fmt; > + int bw; > + int bh; > + int bb; > +} astc_fmt; Since the underscored struct tag is nowhere used, you should remove it. Please add a one-line comment for each of the astc_fmt fields. > + > +static const astc_fmt formats[] = { > +{GL_COMPRESSED_RGBA_ASTC_4x4_KHR , 4, 4, 16}, > +{GL_COMPRESSED_RGBA_ASTC_5x4_KHR , 5, 4, 16}, > +{GL_COMPRESSED_RGBA_ASTC_5x5_KHR , 5, 5, 16}, > +{GL_COMPRESSED_RGBA_ASTC_6x5_KHR , 6, 5, 16}, > +{GL_COMPRESSED_RGBA_ASTC_6x6_KHR , 6, 6, 16}, > +{GL_COMPRESSED_RGBA_ASTC_8x5_KHR , 8, 5, 16}, > +{GL_COMPRESSED_RGBA_ASTC_8x6_KHR , 8, 6, 16}, > +{GL_COMPRESSED_RGBA_ASTC_8x8_KHR , 8, 8, 16}, > +{GL_COMPRESSED_RGBA_ASTC_10x5_KHR , 10, 5, 16}, > +{GL_COMPRESSED_RGBA_ASTC_10x6_KHR , 10, 6, 16}, > +{GL_COMPRESSED_RGBA_ASTC_10x8_KHR , 10, 8, 16}, > +{GL_COMPRESSED_RGBA_ASTC_10x10_KHR, 10, 10, 16}, > +{GL_COMPRESSED_RGBA_ASTC_12x10_KHR, 12, 10, 16}, > +{GL_COMPRESSED_RGBA_ASTC_12x12_KHR, 12, 12, 16}, > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR , 4, 4, 16}, > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR , 5, 4, 16}, > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR , 5, 5, 16}, > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR , 6, 5, 16}, > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR , 6, 6, 16}, > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR , 8, 5, 16}, > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR , 8, 6, 16}, > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR , 8, 8, 16}, > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR , 10, 5, 16}, > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR , 10, 6, 16}, > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR , 10, 8, 16}, > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, 10, 10, 16}, > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, 12, 10, 16}, > +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, 12, 12, 16} > +}; > + > + > +#define REQUIRE_ERROR(expected_error) \ > +do {\ > + if (!piglit_check_gl_error(expected_error))\ > +
Re: [Piglit] [PATCH v2 4/4] Add API tests for KHR_texture_compression_astc_ldr
I assume this should be added to all.py as well? On Fri, Aug 28, 2015 at 09:44:38AM -0700, Nanley Chery wrote: > From: Nanley Chery> > These tests check that the GL error returned by valid and invalid API calls > are as defined by the spec. > > Signed-off-by: Nanley Chery > --- > .../khr_texture_compression_astc/CMakeLists.gl.txt | 1 + > .../CMakeLists.gles2.txt | 1 + > .../khr_compressed_astc-basic.c| 366 > + > 3 files changed, 368 insertions(+) > create mode 100644 > tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c > > diff --git a/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt > b/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt > index a47c7d3..79500f7 100644 > --- a/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt > +++ b/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt > @@ -10,5 +10,6 @@ link_libraries ( > ) > > piglit_add_executable(khr_compressed_astc-miptree_${piglit_target_api} > khr_compressed_astc-miptree.c) > +piglit_add_executable(khr_compressed_astc-basic_${piglit_target_api} > khr_compressed_astc-basic.c) > > # vim: ft=cmake: > diff --git a/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt > b/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt > index 047b8ac..3fb6fa5 100644 > --- a/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt > +++ b/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt > @@ -4,5 +4,6 @@ include_directories( > ) > link_libraries(piglitutil_${piglit_target_api}) > piglit_add_executable(khr_compressed_astc-miptree_${piglit_target_api} > khr_compressed_astc-miptree.c) > +piglit_add_executable(khr_compressed_astc-basic_${piglit_target_api} > khr_compressed_astc-basic.c) > > # vim: ft=cmake: > diff --git > a/tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c > b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c > new file mode 100644 > index 000..d83ad5e > --- /dev/null > +++ b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c > @@ -0,0 +1,366 @@ > +/* > + * Copyright © 2011 Intel Corporation 2014 or 2015 I assume? > + * > + * 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" > + > +static const GLenum cube_map_face_targets[] = { > + GL_TEXTURE_CUBE_MAP_POSITIVE_X, > + GL_TEXTURE_CUBE_MAP_NEGATIVE_X, > + GL_TEXTURE_CUBE_MAP_POSITIVE_Y, > + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, > + GL_TEXTURE_CUBE_MAP_POSITIVE_Z, > + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z > +}; > + > +static const GLenum good_targets[] = { > + GL_TEXTURE_2D_ARRAY, > + GL_TEXTURE_CUBE_MAP_ARRAY_EXT, > + GL_TEXTURE_3D, > +}; > + > +typedef struct _astc_fmt { > + GLenum fmt; > + int bw; > + int bh; > + int bb; > +} astc_fmt; > + > +static const astc_fmt formats[] = { > +{GL_COMPRESSED_RGBA_ASTC_4x4_KHR , 4, 4, 16}, > +{GL_COMPRESSED_RGBA_ASTC_5x4_KHR , 5, 4, 16}, > +{GL_COMPRESSED_RGBA_ASTC_5x5_KHR , 5, 5, 16}, > +{GL_COMPRESSED_RGBA_ASTC_6x5_KHR , 6, 5, 16}, > +{GL_COMPRESSED_RGBA_ASTC_6x6_KHR , 6, 6, 16}, > +{GL_COMPRESSED_RGBA_ASTC_8x5_KHR , 8, 5, 16}, > +{GL_COMPRESSED_RGBA_ASTC_8x6_KHR , 8, 6, 16}, > +{GL_COMPRESSED_RGBA_ASTC_8x8_KHR , 8, 8, 16}, > +{GL_COMPRESSED_RGBA_ASTC_10x5_KHR , 10, 5, 16}, > +{GL_COMPRESSED_RGBA_ASTC_10x6_KHR , 10, 6, 16}, > +{GL_COMPRESSED_RGBA_ASTC_10x8_KHR , 10, 8, 16}, > +{GL_COMPRESSED_RGBA_ASTC_10x10_KHR, 10, 10, 16}, > +{GL_COMPRESSED_RGBA_ASTC_12x10_KHR, 12, 10, 16}, > +{GL_COMPRESSED_RGBA_ASTC_12x12_KHR, 12, 12, 16}, > +
[Piglit] [PATCH v2 4/4] Add API tests for KHR_texture_compression_astc_ldr
From: Nanley Chery nanley.g.ch...@intel.com These tests check that the GL error returned by valid and invalid API calls are as defined by the spec. Signed-off-by: Nanley Chery nanley.g.ch...@intel.com --- .../khr_texture_compression_astc/CMakeLists.gl.txt | 1 + .../CMakeLists.gles2.txt | 1 + .../khr_compressed_astc-basic.c| 366 + 3 files changed, 368 insertions(+) create mode 100644 tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c diff --git a/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt b/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt index a47c7d3..79500f7 100644 --- a/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt +++ b/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt @@ -10,5 +10,6 @@ link_libraries ( ) piglit_add_executable(khr_compressed_astc-miptree_${piglit_target_api} khr_compressed_astc-miptree.c) +piglit_add_executable(khr_compressed_astc-basic_${piglit_target_api} khr_compressed_astc-basic.c) # vim: ft=cmake: diff --git a/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt b/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt index 047b8ac..3fb6fa5 100644 --- a/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt +++ b/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt @@ -4,5 +4,6 @@ include_directories( ) link_libraries(piglitutil_${piglit_target_api}) piglit_add_executable(khr_compressed_astc-miptree_${piglit_target_api} khr_compressed_astc-miptree.c) +piglit_add_executable(khr_compressed_astc-basic_${piglit_target_api} khr_compressed_astc-basic.c) # vim: ft=cmake: diff --git a/tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c new file mode 100644 index 000..d83ad5e --- /dev/null +++ b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c @@ -0,0 +1,366 @@ +/* + * Copyright © 2011 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. + */ + +#include piglit-util-gl.h + +static const GLenum cube_map_face_targets[] = { + GL_TEXTURE_CUBE_MAP_POSITIVE_X, + GL_TEXTURE_CUBE_MAP_NEGATIVE_X, + GL_TEXTURE_CUBE_MAP_POSITIVE_Y, + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, + GL_TEXTURE_CUBE_MAP_POSITIVE_Z, + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z +}; + +static const GLenum good_targets[] = { + GL_TEXTURE_2D_ARRAY, + GL_TEXTURE_CUBE_MAP_ARRAY_EXT, + GL_TEXTURE_3D, +}; + +typedef struct _astc_fmt { + GLenum fmt; + int bw; + int bh; + int bb; +} astc_fmt; + +static const astc_fmt formats[] = { +{GL_COMPRESSED_RGBA_ASTC_4x4_KHR , 4, 4, 16}, +{GL_COMPRESSED_RGBA_ASTC_5x4_KHR , 5, 4, 16}, +{GL_COMPRESSED_RGBA_ASTC_5x5_KHR , 5, 5, 16}, +{GL_COMPRESSED_RGBA_ASTC_6x5_KHR , 6, 5, 16}, +{GL_COMPRESSED_RGBA_ASTC_6x6_KHR , 6, 6, 16}, +{GL_COMPRESSED_RGBA_ASTC_8x5_KHR , 8, 5, 16}, +{GL_COMPRESSED_RGBA_ASTC_8x6_KHR , 8, 6, 16}, +{GL_COMPRESSED_RGBA_ASTC_8x8_KHR , 8, 8, 16}, +{GL_COMPRESSED_RGBA_ASTC_10x5_KHR , 10, 5, 16}, +{GL_COMPRESSED_RGBA_ASTC_10x6_KHR , 10, 6, 16}, +{GL_COMPRESSED_RGBA_ASTC_10x8_KHR , 10, 8, 16}, +{GL_COMPRESSED_RGBA_ASTC_10x10_KHR, 10, 10, 16}, +{GL_COMPRESSED_RGBA_ASTC_12x10_KHR, 12, 10, 16}, +{GL_COMPRESSED_RGBA_ASTC_12x12_KHR, 12, 12, 16}, +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR , 4, 4, 16}, +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR , 5, 4, 16}, +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR , 5, 5, 16}, +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR , 6, 5, 16}, +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR , 6, 6, 16}, +{GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR , 8, 5, 16}, +