aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/mipmap.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-12-22 17:33:44 +0000
committermarha <marha@users.sourceforge.net>2009-12-22 17:33:44 +0000
commitb729d9e1cc1c60e415da24143cabcbaccb525ed7 (patch)
tree54fc81d1a046dc5ec6f4aa2a2d8a2ad015c423fd /mesalib/src/mesa/main/mipmap.c
parent0695dfb71ca6fe132d15a4d0890e8a868183adf9 (diff)
downloadvcxsrv-b729d9e1cc1c60e415da24143cabcbaccb525ed7.tar.gz
vcxsrv-b729d9e1cc1c60e415da24143cabcbaccb525ed7.tar.bz2
vcxsrv-b729d9e1cc1c60e415da24143cabcbaccb525ed7.zip
Updated to mesa_7_6_1_rc1
Diffstat (limited to 'mesalib/src/mesa/main/mipmap.c')
-rw-r--r--mesalib/src/mesa/main/mipmap.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/mesalib/src/mesa/main/mipmap.c b/mesalib/src/mesa/main/mipmap.c
index 3dca09d9f..c3928fa51 100644
--- a/mesalib/src/mesa/main/mipmap.c
+++ b/mesalib/src/mesa/main/mipmap.c
@@ -1501,8 +1501,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
GLuint comps;
ASSERT(texObj);
- /* XXX choose cube map face here??? */
- srcImage = texObj->Image[0][texObj->BaseLevel];
+ srcImage = _mesa_select_tex_image(ctx, texObj, target, texObj->BaseLevel);
ASSERT(srcImage);
maxLevels = _mesa_max_texture_levels(ctx, texObj->Target);
@@ -1510,7 +1509,9 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
/* Find convertFormat - the format that do_row() will process */
if (srcImage->IsCompressed) {
- /* setup for compressed textures */
+ /* setup for compressed textures - need to allocate temporary
+ * image buffers to hold uncompressed images.
+ */
GLuint row;
GLint components, size;
GLchan *dst;
@@ -1587,11 +1588,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
&dstWidth, &dstHeight, &dstDepth);
if (!nextLevel) {
/* all done */
- if (srcImage->IsCompressed) {
- _mesa_free((void *) srcData);
- _mesa_free(dstData);
- }
- return;
+ break;
}
/* get dest gl_texture_image */
@@ -1682,6 +1679,12 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
}
} /* loop over mipmap levels */
+
+ if (srcImage->IsCompressed) {
+ /* free uncompressed image buffers */
+ _mesa_free((void *) srcData);
+ _mesa_free(dstData);
+ }
}