<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 14, 2015 at 3:23 PM, Nanley Chery <span dir="ltr"><<a href="mailto:nanleychery@gmail.com" target="_blank">nanleychery@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Tue, Sep 8, 2015 at 11:45 AM, Chad Versace <span dir="ltr"><<a href="mailto:chad.versace@intel.com" target="_blank">chad.versace@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>On Fri 28 Aug 2015, Nanley Chery wrote:<br>
> From: Nanley Chery <<a href="mailto:nanley.g.chery@intel.com" target="_blank">nanley.g.chery@intel.com</a>><br>
><br>
> These tests check that the GL error returned by valid and invalid API calls<br>
> are as defined by the spec.<br>
><br>
> Signed-off-by: Nanley Chery <<a href="mailto:nanley.g.chery@intel.com" target="_blank">nanley.g.chery@intel.com</a>><br>
> ---<br>
>  .../khr_texture_compression_astc/CMakeLists.gl.txt |   1 +<br>
>  .../CMakeLists.gles2.txt                           |   1 +<br>
>  .../khr_compressed_astc-basic.c                    | 366 +++++++++++++++++++++<br>
>  3 files changed, 368 insertions(+)<br>
>  create mode 100644 tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c<br>
><br>
> diff --git a/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt b/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt<br>
> index a47c7d3..79500f7 100644<br>
> --- a/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt<br>
> +++ b/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt<br>
> @@ -10,5 +10,6 @@ link_libraries (<br>
>  )<br>
><br>
>  piglit_add_executable(khr_compressed_astc-miptree_${piglit_target_api} khr_compressed_astc-miptree.c)<br>
> +piglit_add_executable(khr_compressed_astc-basic_${piglit_target_api} khr_compressed_astc-basic.c)<br>
><br>
>  # vim: ft=cmake:<br>
> diff --git a/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt b/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt<br>
> index 047b8ac..3fb6fa5 100644<br>
> --- a/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt<br>
> +++ b/tests/spec/khr_texture_compression_astc/CMakeLists.gles2.txt<br>
> @@ -4,5 +4,6 @@ include_directories(<br>
>  )<br>
>  link_libraries(piglitutil_${piglit_target_api})<br>
>  piglit_add_executable(khr_compressed_astc-miptree_${piglit_target_api} khr_compressed_astc-miptree.c)<br>
> +piglit_add_executable(khr_compressed_astc-basic_${piglit_target_api} khr_compressed_astc-basic.c)<br>
><br>
>  # vim: ft=cmake:<br>
> 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<br>
> new file mode 100644<br>
> index 0000000..d83ad5e<br>
> --- /dev/null<br>
> +++ b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-basic.c<br>
> @@ -0,0 +1,366 @@<br>
<br>
</div></div><span>> +#include "piglit-util-gl.h"<br>
> +<br>
> +static const GLenum cube_map_face_targets[] = {<br>
> +   GL_TEXTURE_CUBE_MAP_POSITIVE_X,<br>
> +   GL_TEXTURE_CUBE_MAP_NEGATIVE_X,<br>
> +   GL_TEXTURE_CUBE_MAP_POSITIVE_Y,<br>
> +   GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,<br>
> +   GL_TEXTURE_CUBE_MAP_POSITIVE_Z,<br>
> +   GL_TEXTURE_CUBE_MAP_NEGATIVE_Z<br>
> +};<br>
> +<br>
> +static const GLenum good_targets[] = {<br>
<br>
</span>There are additional good targets: 3D and and CUBE_MAP. Please rename<br>
this variable to indicate that these are "good targets" for<br>
glCompressedTex*3D().<br>
<span><br></span></blockquote></div></div><div>I'm not sure what you mean by additional good targets. I've renamed the<br></div><div>variable to good_compressed_tex_3d_targets.<br></div><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>
> +   GL_TEXTURE_2D_ARRAY,<br>
> +   GL_TEXTURE_CUBE_MAP_ARRAY_EXT,<br>
> +   GL_TEXTURE_3D,<br>
> +};<br>
> +<br>
> +typedef struct _astc_fmt {<br>
> +     GLenum fmt;<br>
> +     int bw;<br>
> +     int bh;<br>
> +     int bb;<br>
> +} astc_fmt;<br>
<br>
</span>Since the underscored struct tag is nowhere used, you should remove it.<br>
<br>
Please add a one-line comment for each of the astc_fmt fields.<br>
<div><div><br></div></div></blockquote></span><div>Fixed these two. <br></div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>
> +<br>
> +static const astc_fmt formats[] = {<br>
> +    {GL_COMPRESSED_RGBA_ASTC_4x4_KHR          ,  4,  4, 16},<br>
> +    {GL_COMPRESSED_RGBA_ASTC_5x4_KHR          ,  5,  4, 16},<br>
> +    {GL_COMPRESSED_RGBA_ASTC_5x5_KHR          ,  5,  5, 16},<br>
> +    {GL_COMPRESSED_RGBA_ASTC_6x5_KHR          ,  6,  5, 16},<br>
> +    {GL_COMPRESSED_RGBA_ASTC_6x6_KHR          ,  6,  6, 16},<br>
> +    {GL_COMPRESSED_RGBA_ASTC_8x5_KHR          ,  8,  5, 16},<br>
> +    {GL_COMPRESSED_RGBA_ASTC_8x6_KHR          ,  8,  6, 16},<br>
> +    {GL_COMPRESSED_RGBA_ASTC_8x8_KHR          ,  8,  8, 16},<br>
> +    {GL_COMPRESSED_RGBA_ASTC_10x5_KHR         , 10,  5, 16},<br>
> +    {GL_COMPRESSED_RGBA_ASTC_10x6_KHR         , 10,  6, 16},<br>
> +    {GL_COMPRESSED_RGBA_ASTC_10x8_KHR         , 10,  8, 16},<br>
> +    {GL_COMPRESSED_RGBA_ASTC_10x10_KHR        , 10, 10, 16},<br>
> +    {GL_COMPRESSED_RGBA_ASTC_12x10_KHR        , 12, 10, 16},<br>
> +    {GL_COMPRESSED_RGBA_ASTC_12x12_KHR        , 12, 12, 16},<br>
> +    {GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR  ,  4,  4, 16},<br>
> +    {GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR  ,  5,  4, 16},<br>
> +    {GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR  ,  5,  5, 16},<br>
> +    {GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR  ,  6,  5, 16},<br>
> +    {GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR  ,  6,  6, 16},<br>
> +    {GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR  ,  8,  5, 16},<br>
> +    {GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR  ,  8,  6, 16},<br>
> +    {GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR  ,  8,  8, 16},<br>
> +    {GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR , 10,  5, 16},<br>
> +    {GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR , 10,  6, 16},<br>
> +    {GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR , 10,  8, 16},<br>
> +    {GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, 10, 10, 16},<br>
> +    {GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, 12, 10, 16},<br>
> +    {GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, 12, 12, 16}<br>
> +};<br>
> +<br>
> +<br>
> +#define REQUIRE_ERROR(expected_error) \<br>
> +do {\<br>
> +     if (!piglit_check_gl_error(expected_error))\<br>
> +             piglit_report_result(PIGLIT_FAIL);\<br>
> +} while (0)<br>
<br>
</div></div>Add a space before the line-continuation slashes. That's the style found<br>
elsewhere in Piglit. Like this:<br>
<br>
#define REQUIRE_ERROR(expected_error) \<br>
        do { \<br>
                blah; \<br>
        } while (0)<br>
<div><div><br></div></div></blockquote><div><br></div></div></div><div>Fixed.<br></div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>
<br>
> +/*<br>
> + * The KHR_texture_compression_astc_ldr spec says:<br>
> + *   * An INVALID_OPERATION error is generated by CompressedTexImage3D if<br>
> + *   <internalformat> is one of the the formats in table 8.19 and <target><br>
> + *   is not TEXTURE_2D_ARRAY, TEXTURE_CUBE_MAP_ARRAY, or TEXTURE_3D.<br>
> + *<br>
> + *   * An INVALID_OPERATION error is generated by CompressedTexImage3D if<br>
> + *   <internalformat> is TEXTURE_CUBE_MAP_ARRAY and the "Cube Map Array"<br>
> + *   column of table 8.19 is *not* checked, or if <internalformat> is<br>
> + *   TEXTURE_3D and the "3D Tex." column of table 8.19 is *not* checked"<br>
> + *<br>
> + * Discussion:<br>
> + *   * Since this extension only increases the allowed targets, the<br>
> + *   existing errors are assumed to be already handled, and the allowed<br>
> + *   targets are tested to be free of errors.<br>
> + *<br>
> + *   * Since all ASTC formats have the "Cube Map Array" column checked,<br>
> + *   test that no error is generated from calling CompressedTexImage3D with<br>
> + *   the TEXTURE_CUBE_MAP_ARRAY target.<br>
> + *<br>
> + */<br>
> +void test_compressed_teximg_3d(int fi, bool have_cube_map_ext)<br>
> +{<br>
> +     int j;<br>
> +     GLuint tex3D;<br>
> +     char fake_tex_data[6*16];<br>
> +     bool have_hdr = piglit_is_extension_supported(<br>
> +                     "GL_KHR_texture_compression_astc_hdr");<br>
> +<br>
> +     for (j = 0; j < ARRAY_SIZE(good_targets); ++j) {<br>
> +<br>
> +             /* Skip the cube_map target if there's no support */<br>
> +             if (good_targets[j] == GL_TEXTURE_CUBE_MAP_ARRAY_EXT &&<br>
> +                     !have_cube_map_ext)<br>
> +                     continue;<br>
> +<br>
> +             /* Run the command */<br>
> +             glGenTextures(1, &tex3D);<br>
> +             glBindTexture(good_targets[j], tex3D);<br>
> +             glCompressedTexImage3D(good_targets[j], 0, formats[fi].fmt,<br>
> +                     4, 4, 6, 0, 6*formats[fi].bb, fake_tex_data);<br>
> +<br>
> +             /* Test expected GL errors */<br>
> +             if (good_targets[j] == GL_TEXTURE_3D && !have_hdr) {<br>
> +                     REQUIRE_ERROR(GL_INVALID_OPERATION);<br>
> +             } else {<br>
> +                     REQUIRE_ERROR(GL_NO_ERROR);<br>
> +             }<br>
> +<br>
> +             glDeleteTextures(1, &tex3D);<br>
> +     }<br>
> +}<br>
> +<br>
> +/*<br>
> + * The KHR_texture_compression_astc_ldr spec says:<br>
> + *  "An INVALID_VALUE error is generated by<br>
> + *<br>
> + *     * CompressedTexImage2D if <target> is<br>
> + *       one of the cube map face targets from table 8.21, and<br>
> + *     * CompressedTexImage3D if <target> is TEXTURE_CUBE_MAP_ARRAY,<br>
> + *<br>
> + *   and <width> and <height> are not equal."<br>
> + */<br>
> +void test_non_square_img(int fi)<br>
> +{<br>
> +     int j;<br>
> +     char fake_tex_data[6*16];<br>
> +     GLuint cube_tex;<br>
> +<br>
> +     glGenTextures(1, &cube_tex);<br>
> +     glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY_EXT, cube_tex);<br>
> +<br>
> +     /* Test CompressedTexImage2D */<br>
> +     for (j = 0; j < ARRAY_SIZE(cube_map_face_targets); ++j) {<br>
> +             glCompressedTexImage2D(cube_map_face_targets[j], 0,<br>
> +                                     formats[fi].fmt, 4, 3, 0,<br>
> +                                     formats[fi].bb, fake_tex_data);<br>
> +             REQUIRE_ERROR(GL_INVALID_VALUE);<br>
> +     }<br>
> +<br>
> +     /* Test CompressedTexImage3D */<br>
> +     glCompressedTexImage3D(GL_TEXTURE_CUBE_MAP_ARRAY_EXT, 0,<br>
> +             formats[fi].fmt, 4, 3, 6, 0, 6*formats[fi].bb, fake_tex_data);<br>
> +     REQUIRE_ERROR(GL_INVALID_VALUE);<br>
<br>
</div></div>If HDR is unsupported, I think glCompressedTexImage3D is allowed to<br>
emit GL_INVALID_OPERATION here. So, I think glCompressedTexImage3D()<br>
should be tested on non-square dimensions only if HDR is supported.<br>
<div><div><br></div></div></blockquote></div></div><div>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.<br></div></div></div></div></blockquote><div><br></div><div>I take that back. There's no indication that GL_TEXTURE_CUBE_MAP_ARRAY_EXT isn't supported as a target for glCompressedTexImage3D on LDR-only systems. <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>
> +<br>
> +     glDeleteTextures(1, &cube_tex);<br>
> +<br>
> +}<br>
> +<br>
> +int get_expected_size(int width, int height, int bw, int bh, int bb)<br>
> +{<br>
> +     int nbw = (width + bw - 1) / bw;<br>
> +     int nbh = (height + bh - 1) / bh;<br>
> +     return nbw * nbh * bb;<br>
> +}<br>
> +<br>
> +<br>
> +/*<br>
> + * The KHR_texture_compression_astc_ldr spec says:<br>
> + *  * "An INVALID_OPERATION error is generated if format is one of the formats<br>
> + *    in table 8.19 and any of the following conditions occurs. The block<br>
> + *    width and height refer to the values in the corresponding column of the<br>
> + *    table.<br>
> + *<br>
> + *      * <width> is not a multiple of the format's block width, and <width> +<br>
> + *        <xoffset> is not equal to the value of TEXTURE_WIDTH.<br>
> + *      * height is not a multiple of the format's block height, and <height><br>
> + *        + <yoffset> is not equal to the value of TEXTURE_HEIGHT.<br>
> + *      * <xoffset> or <yoffset> is not a multiple of the block width or<br>
> + *        height, respectively."<br>
> + *<br>
> + *   [...]<br>
> + *<br>
> + *   ASTC texture formats are supported by immutable-format textures only if<br>
> + *   such textures are supported by the underlying implementation (e.g.<br>
> + *   OpenGL 4.1 or later, OpenGL ES 3.0 or later, or earlier versions<br>
> + *   supporting the GL_EXT_texture_storage extension). Otherwise, remove all<br>
> + *   references to the Tex*Storage* commands from this specification.<br>
> + */<br>
> +void test_sub_img(int fi)<br>
> +{<br>
> +     GLuint tex;<br>
> +     char fake_tex_data[4*16];<br>
> +     int width = 7;<br>
> +     int height = 7;<br>
<br>
> +     int expectedSizeGood = get_expected_size(4, 4,<br>
> +                             formats[fi].bw,<br>
> +                             formats[fi].bh, formats[fi].bb);<br>
> +     int expectedSizeBad = get_expected_size(width, height,<br>
> +                             formats[fi].bw,<br>
> +                             formats[fi].bh, formats[fi].bb);<br>
<br>
</div></div>Piglit doesn't use camelCase. These variables should be snake_case.<br>
<span><br></span></blockquote></div></div><div>Fixed. <br></div><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>
> +<br>
> +     /* Allocate enough to hold the larger case */<br>
> +     glGenTextures(1, &tex);<br>
> +     glBindTexture(GL_TEXTURE_2D, tex);<br>
> +     glTexStorage2D(GL_TEXTURE_2D, 1, formats[fi].fmt, 14, 14);<br>
> +     REQUIRE_ERROR(GL_NO_ERROR);<br>
<br>
</span>To prevent unintended crashes, especially for the bad case, the test<br>
should:<br>
    assert(expectedSizeGood) <= sizeof(fake_tex_data);<br>
    assert(expectedSizeBad) <= sizeof(fake_tex_data);<br>
<span><br></span></blockquote></span><div>Fixed. <br></div><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>
> +<br>
> +     /* Check for No Error */<br>
> +     glCompressedTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0,<br>
> +             formats[fi].bw, formats[fi].bh,<br>
> +             formats[fi].fmt, expectedSizeGood, fake_tex_data);<br>
> +     REQUIRE_ERROR(GL_NO_ERROR);<br>
> +<br>
> +     /* Check for expected Error */<br>
> +     glCompressedTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height,<br>
> +                     formats[fi].fmt, expectedSizeBad, fake_tex_data);<br>
> +     REQUIRE_ERROR(GL_INVALID_OPERATION);<br>
> +<br>
> +     glDeleteTextures(1, &tex);<br>
> +<br>
> +     if (piglit_is_extension_supported("GL_EXT_texture_storage")) {<br>
</span>If I interpreted the ASTC spec correctly, then this block should be<br>
taken even when the GL_EXT_texture_storage string is not advertised. It<br>
should be taken if have_tex_storage_support().<br>
<div><div><br></div></div></blockquote></span><div>I checked for this extension for the call to glTextureStorage3DEXT.<br><br></div><div>Spec quote:<br></div><div><pre>    If extension "EXT_texture_storage" is supported, these tokens are also
    accepted by TexStorage2DEXT, TextureStorage2DEXT, TexStorage3DEXT and
    TextureStorage3DEXT.<br><br></pre>Since Mesa actually doesn't support these functions, I'll call glTexStorage3D instead and remove the condition.<br><br></div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>
> +             /* Check for expected Error */<br>
> +             glGenTextures(1, &tex);<br>
> +             glTextureStorage3DEXT(tex, GL_TEXTURE_3D, 1, formats[fi].fmt,<br>
> +                                     14, 14, 1);<br>
> +             glCompressedTexImage3D(GL_TEXTURE_3D, 0, formats[fi].fmt,<br>
> +                             7, 7, 1, 0, expectedSizeBad, fake_tex_data);<br>
> +             REQUIRE_ERROR(GL_INVALID_OPERATION);<br>
> +             glDeleteTextures(1, &tex);<br>
> +     }<br>
> +}<br>
> +<br>
> +/*<br>
> + * The KHR_texture_compression_astc_ldr spec says:<br>
> + *   [...] the ASTC format specifiers will not be added to<br>
> + *   Table 3.14, and thus will not be accepted by the TexImage*D<br>
> + *   functions, and will not be returned by the (already deprecated)<br>
> + *   COMPRESSED_TEXTURE_FORMATS query.<br>
> + *<br>
> + * Discussion:<br>
> + *   The deprecated query is handled by:<br>
> + *   tests/spec/arb_texture_compression/invalid-formats.c<br>
> + *   In TexImage*D, the format should be automatically<br>
> + *   converted to the base internal format of GL_RGBA.<br>
> + */<br>
> +void test_tex_img(int fi, bool have_mipmap)<br>
> +{<br>
> +     GLuint tex;<br>
> +     char fake_tex_data[16];<br>
> +     glGenTextures(1, &tex);<br>
> +     glBindTexture(GL_TEXTURE_2D, tex);<br>
<br>
</div></div>When C code follows the C89 style (as all Pigit code does), an empty<br>
line should separate the block of variable declarations from the first<br>
function call.<br>
<span><br></span></blockquote></div></div><div>Fixed. <br></div><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>
> +<br>
> +     /* Allocate for an ASTC texture for following texsubimage calls<br>
</span>        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br>
Incomplete phrase.<br>
<div><div><br></div></div></blockquote></span><div>Fixed. <br></div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>
> +      * Since TexImage*D must fail, then the corresponding TexSubImage<br>
> +      * calls must fail as well.<br>
> +      */<br>
> +     glCompressedTexImage2D(GL_TEXTURE_2D, 0,<br>
> +             formats[fi].fmt, 4, 4, 0, formats[fi].bb, fake_tex_data);<br>
> +     REQUIRE_ERROR(GL_NO_ERROR);<br>
> +<br>
> +     /* Check for expected error from Tex*Image*D family of functions */<br>
> +     glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0,<br>
> +             4, 4, GL_RGBA, GL_UNSIGNED_BYTE, fake_tex_data);<br>
> +     REQUIRE_ERROR(GL_INVALID_OPERATION);<br>
> +<br>
> +     glTexImage2D(GL_TEXTURE_2D, 0,<br>
> +             formats[fi].fmt, 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);<br>
> +     REQUIRE_ERROR(GL_INVALID_OPERATION);<br>
> +<br>
> +     glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 4, 4);<br>
> +     REQUIRE_ERROR(GL_INVALID_OPERATION);<br>
> +<br>
> +     glCopyTexImage2D(GL_TEXTURE_2D, 0, formats[fi].fmt, 0, 0, 4, 4, 0);<br>
> +     REQUIRE_ERROR(GL_INVALID_OPERATION);<br>
> +<br>
> +     /* Check for expected error from the online compression resulting from<br>
> +      * calling GenerateMipmap.<br>
> +      */<br>
> +     if (have_mipmap) {<br>
> +             glGenerateMipmap(GL_TEXTURE_2D);<br>
> +             REQUIRE_ERROR(GL_INVALID_OPERATION);<br>
> +     }<br>
> +<br>
> +     glDeleteTextures(1, &tex);<br>
> +<br>
> +}<br>
> +<br>
> +bool static inline<br>
> +have_tex_storage_support()<br>
> +{<br>
> +#if defined (PIGLIT_USE_OPENGL)<br>
> +     return piglit_get_gl_version() >= 42 ||<br>
> +             piglit_is_extension_supported("GL_ARB_texture_storage");<br>
> +#else<br>
> +     return piglit_get_gl_version() >= 30 ||<br>
> +             piglit_is_extension_supported("GL_EXT_texture_storage");<br>
> +#endif<br>
> +}<br>
> +<br>
> +<br>
> +bool static inline<br>
> +have_cube_map_array_support()<br>
> +{<br>
> +#if defined (PIGLIT_USE_OPENGL_ES3)<br>
<br>
</div></div>I don't believe this block is reachable because the config block<br>
declares<br>
    config.supports_gl_es_version = 10<br>
instead of 30.<br>
<br>
Rather than fidget with GLES version, though, it's best to just use the<br>
same preprocessor pattern that you used in have_tex_storage_support(),<br>
which should work regardless of the GLES version.<br>
<span><br></span></blockquote></div></div><div>Fixed. <br></div><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>
> +     return piglit_is_extension_supported("GL_EXT_texture_cube_map_array");<br>
> +#elif defined (PIGLIT_USE_OPENGL)<br>
> +     return piglit_get_gl_version() >= 40 ||<br>
> +             piglit_is_extension_supported("GL_ARB_texture_cube_map_array");<br>
> +#endif<br>
> +     return false;<br>
> +}<br>
> +<br>
> +<br>
> +enum piglit_result<br>
> +piglit_display(void)<br>
> +{<br>
> +     unsigned i;<br>
> +     bool have_cube_map_ext = have_cube_map_array_support();<br>
> +     bool have_tex_stor_ext = have_tex_storage_support();<br>
<br>
> +     bool have_mipmap = piglit_is_extension_supported("GL_ARB_framebuffer_object");<br>
<br>
</span>Please rename have_mipmap to have_generate_mipmap, have_gen_mipmap, or<br>
something similar. Also, the check looks incorrect. Is glGenerateMipmap<br>
really associated with GL_ARB_framebuffer_object?<br>
<span><br>
<br></span></blockquote></span><div>It isn't associated. Fixed. <br></div><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>
> +     for (i = 0; i < ARRAY_SIZE(formats); i++) {<br>
> +             if (have_cube_map_ext)<br>
> +                     test_non_square_img(i);<br>
> +             if (have_tex_stor_ext)<br>
> +                     test_sub_img(i);<br>
> +             test_compressed_teximg_3d(i, have_cube_map_ext);<br>
> +             test_tex_img(i, have_mipmap);<br>
> +     }<br>
> +<br>
> +     piglit_report_result(PIGLIT_PASS);<br>
> +}<br>
> +<br>
<br>
<br>
</span><span>> +PIGLIT_GL_TEST_CONFIG_BEGIN<br>
> +<br>
> +     config.supports_gl_compat_version = 11;<br>
> +     config.supports_gl_es_version = 10;<br>
<br>
</span>Bumping the required ES version from 1.0 to 2.0 will improve test<br>
coverage. GLES 2.0 implementations are much more common that GLES 1.0<br>
implementations.<br>
<span><br></span></blockquote></span><div>Fixed. <br></div><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>
> +<br>
> +     config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;<br>
> +<br>
> +PIGLIT_GL_TEST_CONFIG_END<br>
<br>
</span>The config block should near the top of the file, preferably before any<br>
functions or static data.<br>
</blockquote></span></div>Fixed.<br></div></div>
</blockquote></div><br></div></div>