st/mesa: fill in stImage->level in st_generate_mipmap()
authorBrian Paul <brianp@vmware.com>
Wed, 28 Apr 2010 16:05:00 +0000 (10:05 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 28 Apr 2010 16:05:06 +0000 (10:05 -0600)
Before, this field was always zero for all the new mipmap levels.
Fixes problems with glGetTexImage() from a generated mipmap.

src/mesa/state_tracker/st_gen_mipmap.c

index f67d7b4cb5cbbfd427de370d341aa5e2b6736008..4a3e38de449a6348d877372fa7a16f97f2bd8438 100644 (file)
@@ -297,7 +297,9 @@ st_generate_mipmap(GLcontext *ctx, GLenum target,
 
       dstImage->TexFormat = srcImage->TexFormat;
 
-      stImage = (struct st_texture_image *) dstImage;
+      stImage = st_texture_image(dstImage);
+      stImage->level = dstLevel;
+
       pipe_texture_reference(&stImage->pt, pt);
    }
 }