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.
On Wed, Dec 31, 2014 at 12:23 PM, Anuj Phogat <anuj.pho...@gmail.com> wrote: > On Mon, Dec 15, 2014 at 5:22 PM, Laura Ekstrand <la...@jlekstrand.net> > wrote: > > This is part of a potential solution to Khronos Bug 13223. Cube > completeness > > is a concept from glGenerateMipmap, but it seems reasonable to check for > it in > > GetTextureImage when the target is GL_TEXTURE_CUBE_MAP. > Add this to the comment in source file so that no one gets confused about > what GenerateTextureMipmap error is doing in GetTextureImage. > > --- > > src/mesa/main/texgetimage.c | 25 +++++++++++++------------ > > 1 file changed, 13 insertions(+), 12 deletions(-) > > > > diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c > > index 3cc3df6..29b1cb4 100644 > > --- a/src/mesa/main/texgetimage.c > > +++ b/src/mesa/main/texgetimage.c > > @@ -1105,18 +1105,19 @@ _mesa_GetTextureImage( GLuint texture, GLint > level, GLenum format, > > "glGetTextureImage(insufficient cube map > storage)"); > > return; > > } > > - for (i = 0; i < 6; ++i) { /* For each face. */ > > - if (!texObj->Image[i][level]) { > > - /* Not enough image planes for a cube map. The spec does > not say > > - * what should happen in this case because the user has > always > > - * specified each cube face separately (using > > - * GL_TEXTURE_CUBE_MAP_POSITIVE_X+i) in previous GL > versions. > > - * This is addressed in Khronos Bug 13223. > > - */ > > - _mesa_error(ctx, GL_INVALID_OPERATION, > > - "glGetTextureImage(insufficient cube map > storage)"); > > - return; > > - } > > + if (!_mesa_cube_complete(texObj)) { > > + /* > > + * In Section 8.14.4 Manual Mipmap Generation, the OpenGL 4.5 > Core > > + * Profile spec (30.10.2014) says: > > + * "An INVALID_OPERATION error is generated by > > + * GenerateTextureMipmap if the effective target is > > + * TEXTURE_CUBE_MAP or TEXTURE_CUBE_MAP_ARRAY, and the > texture > > + * object is not cube complete or cube array complete, > > + * respectively." > > + */ > > + _mesa_error(ctx, GL_INVALID_OPERATION, > > + "glGetTextureImage(cube map incomplete)"); > > + return; > > } > > > > > > -- > > 2.1.0 > > > > _______________________________________________ > > mesa-dev mailing list > > mesa-dev@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/mesa-dev >
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev