<div dir="ltr">I added a clearer explanation based on our irc discussion:<br><br><a href="http://cgit.freedesktop.org/~ldeks/mesa/commit/?h=adsa-textures&id=db418437915bba959c0b6c8babe40f675bbdf31c">http://cgit.freedesktop.org/~ldeks/mesa/commit/?h=adsa-textures&id=db418437915bba959c0b6c8babe40f675bbdf31c</a><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 1, 2015 at 11:15 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 12/31/2014 05:26 PM, Laura Ekstrand wrote:<br>
> This is part of a potential solution to Khronos Bug 13223.  Cube completeness<br>
> is a concept from glGenerateMipmap, but it seems reasonable to check for it in<br>
> GetTextureImage when the target is GL_TEXTURE_CUBE_MAP.<br>
> ---<br>
>  src/mesa/main/texgetimage.c | 41 +++++++++++++++++++++++++++++------------<br>
>  1 file changed, 29 insertions(+), 12 deletions(-)<br>
><br>
> diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c<br>
> index 5b4d294..060c68a 100644<br>
> --- a/src/mesa/main/texgetimage.c<br>
> +++ b/src/mesa/main/texgetimage.c<br>
> @@ -1105,18 +1105,35 @@ _mesa_GetTextureImage( GLuint texture, GLint level, GLenum format,<br>
>                       "glGetTextureImage(insufficient cube map storage)");<br>
>           return;<br>
>        }<br>
> -      for (i = 0; i < 6; ++i) { /* For each face. */<br>
> -         if (!texObj->Image[i][level]) {<br>
> -            /* Not enough image planes for a cube map.  The spec does not say<br>
> -             * what should happen in this case because the user has always<br>
> -             * specified each cube face separately (using<br>
> -             * GL_TEXTURE_CUBE_MAP_POSITIVE_X+i) in previous GL versions.<br>
> -             * This is addressed in Khronos Bug 13223.<br>
> -             */<br>
> -            _mesa_error(ctx, GL_INVALID_OPERATION,<br>
> -                        "glGetTextureImage(insufficient cube map storage)");<br>
> -            return;<br>
> -         }<br>
> +<br>
> +      /*<br>
> +       * This is part of a potential solution to a bug in the spec. According<br>
> +       * to Section 8.17 Texture Completeness in the OpenGL 4.5 Core Profile<br>
> +       * spec (30.10.2014):<br>
> +       *    "[A] cube map texture is cube complete if the<br>
> +       *    following conditions all hold true: The [base level] texture<br>
> +       *    images of each of the six cube map faces have identical, positive,<br>
> +       *    and square dimensions. The [base level] images were each specified<br>
> +       *    with the same internal format."<br>
> +       *<br>
> +       * It seems reasonable to check for cube completeness of an arbitrary<br>
> +       * level here so that the returned data has a consistent format and size<br>
> +       * and therefore fits in the user's buffer.<br>
> +       */<br>
<br>
</div></div>The above comment is very confusing, unless the reader has had a conversation with<br>
you about the topic ;). The comment alludes to a "bug in the spec" and "a potential solution",<br>
but the comment does not state what the bug is. The reader has to guess based on the clues<br>
you give. For the sake of the future devs, please directly describe the bug.<br>
<span class=""><br>
> +      if (!_mesa_cube_level_complete(texObj, level)) {<br>
> +         /*<br>
> +          * Precedence for this error:<br>
> +          * In Section 8.14.4 Manual Mipmap Generation, the OpenGL 4.5 Core<br>
> +          * Profile spec (30.10.2014) says:<br>
> +          *    "An INVALID_OPERATION error is generated by<br>
> +          *    GenerateTextureMipmap if the effective target is<br>
> +          *    TEXTURE_CUBE_MAP or TEXTURE_CUBE_MAP_ARRAY, and the texture<br>
> +          *    object is not cube complete or cube array complete,<br>
> +          *    respectively."<br>
> +          */<br>
<br>
</span>I suggest removing the comment above. I don't believe you need to provide precedent<br>
for emitting GL_INVALID_OPERATION here, since it is a catch-all generic error.<br>
Just a suggestion.<br>
<div class="HOEnZb"><div class="h5"><br>
> +         _mesa_error(ctx, GL_INVALID_OPERATION,<br>
> +                     "glGetTextureImage(cube map incomplete)");<br>
> +         return;<br>
>        }<br>
<br>
<br>
</div></div></blockquote></div><br></div>