summaryrefslogtreecommitdiff
path: root/src/mesa/main/mipmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/mipmap.c')
-rw-r--r--src/mesa/main/mipmap.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c
index b602d920df..7350c7a3d2 100644
--- a/src/mesa/main/mipmap.c
+++ b/src/mesa/main/mipmap.c
@@ -1502,16 +1502,18 @@ _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);
ASSERT(maxLevels > 0); /* bad target */
/* Find convertFormat - the format that do_row() will process */
+
if (_mesa_is_format_compressed(srcImage->TexFormat)) {
- /* 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;