mesa: added another check in check_gen_mipmap()

We don't need to call ctx->Driver.GenerateMipmap() if we're updating
a texture level >= MAX_LEVEL.
This commit is contained in:
Brian Paul 2009-11-16 08:14:23 -07:00
parent d3a37d93ab
commit ecb03d75a2
1 changed files with 3 additions and 1 deletions

View File

@ -2035,7 +2035,9 @@ check_gen_mipmap(GLcontext *ctx, GLenum target,
struct gl_texture_object *texObj, GLint level)
{
ASSERT(target != GL_TEXTURE_CUBE_MAP);
if (texObj->GenerateMipmap && level == texObj->BaseLevel) {
if (texObj->GenerateMipmap &&
level == texObj->BaseLevel &&
level < texObj->MaxLevel) {
ASSERT(ctx->Driver.GenerateMipmap);
ctx->Driver.GenerateMipmap(ctx, target, texObj);
}