mesa: added another check in check_gen_mipmap()
authorBrian Paul <brianp@vmware.com>
Mon, 16 Nov 2009 15:14:23 +0000 (08:14 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 16 Nov 2009 15:18:03 +0000 (08:18 -0700)
We don't need to call ctx->Driver.GenerateMipmap() if we're updating
a texture level >= MAX_LEVEL.

src/mesa/main/teximage.c

index b10076875bc84bc992819bed45473c2bab4da833..b946f3c69d7e846f9dc6c09ac60b377d4c82d62f 100644 (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);
    }