diff options
author | Brian Paul <[email protected]> | 2010-12-06 15:11:41 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-12-06 17:10:05 -0700 |
commit | ecb7cc3319a74bda1edc226a1103f0e1a86d92a9 (patch) | |
tree | 09b2b406453631a67f5ebb976f04ca3bd9016c6c /src/mesa/main/fbobject.c | |
parent | c17c7903871b031162e41d6495a1bef64844e19b (diff) |
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.
Diffstat (limited to 'src/mesa/main/fbobject.c')
-rw-r--r-- | src/mesa/main/fbobject.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 47ac6306cfe..975063d0d78 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -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; |