<div dir="ltr">I began adding to my comment as you suggested, but found out that cube completeness only applies to the base level of a cube map. So I had to modify this patch to check for cube completeness of an arbitrary level. I will be sending out a new patch "Checking for cube completeness in GetTextureImage" and another new one for "Checking for cube completeness in TextureSubImage." I will also send a patch to add a function _mesa_cube_level_complete.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 31, 2014 at 12:23 PM, Anuj Phogat <span dir="ltr"><<a href="mailto:anuj.phogat@gmail.com" target="_blank">anuj.phogat@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, Dec 15, 2014 at 5:22 PM, Laura Ekstrand <<a href="mailto:laura@jlekstrand.net">laura@jlekstrand.net</a>> 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>
</span>Add this to the comment in source file so that no one gets confused about<br>
what GenerateTextureMipmap error is doing in GetTextureImage.<br>
<div><div class="h5">> ---<br>
> src/mesa/main/texgetimage.c | 25 +++++++++++++------------<br>
> 1 file changed, 13 insertions(+), 12 deletions(-)<br>
><br>
> diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c<br>
> index 3cc3df6..29b1cb4 100644<br>
> --- a/src/mesa/main/texgetimage.c<br>
> +++ b/src/mesa/main/texgetimage.c<br>
> @@ -1105,18 +1105,19 @@ _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>
> + if (!_mesa_cube_complete(texObj)) {<br>
> + /*<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>
> + _mesa_error(ctx, GL_INVALID_OPERATION,<br>
> + "glGetTextureImage(cube map incomplete)");<br>
> + return;<br>
> }<br>
><br>
><br>
> --<br>
> 2.1.0<br>
><br>
</div></div>> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div><br></div>