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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user