mesa: test for cube map completeness in glGenerateMipmap()

The texture is not cube complete if the base level images aren't of
the same size and format.

NOTE: This is a candidate for the 7.9 branch.
This commit is contained in:
Brian Paul
2010-12-06 15:11:41 -07:00
parent c17c790387
commit ecb7cc3319
3 changed files with 49 additions and 0 deletions

View File

@@ -2146,6 +2146,7 @@ _mesa_GenerateMipmapEXT(GLenum target)
/* OK, legal value */
break;
default:
/* XXX need to implement GL_TEXTURE_1D_ARRAY and GL_TEXTURE_2D_ARRAY */
_mesa_error(ctx, GL_INVALID_ENUM, "glGenerateMipmapEXT(target)");
return;
}
@@ -2157,6 +2158,13 @@ _mesa_GenerateMipmapEXT(GLenum target)
return;
}
if (texObj->Target == GL_TEXTURE_CUBE_MAP &&
!_mesa_cube_complete(texObj)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGenerateMipmap(incomplete cube map)");
return;
}
_mesa_lock_texture(ctx, texObj);
if (target == GL_TEXTURE_CUBE_MAP) {
GLuint face;