radeon: fix mipmap_limits crasher.
authorDave Airlie <airlied@redhat.com>
Tue, 9 Jun 2009 03:52:58 +0000 (13:52 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 9 Jun 2009 03:52:58 +0000 (13:52 +1000)
This gets the correct srclvl image map when uploading images to the new mipmap.

src/mesa/drivers/dri/radeon/radeon_texture.c

index 564da19..0d87f15 100644 (file)
@@ -830,7 +830,7 @@ static void migrate_image_to_miptree(radeon_mipmap_tree *mt, radeon_texture_imag
                 * In fact, that memcpy() could be done by the hardware in many
                 * cases, provided that we have a proper memory manager.
                 */
-               radeon_mipmap_level *srclvl = &image->mt->levels[image->mtlevel];
+               radeon_mipmap_level *srclvl = &image->mt->levels[image->mtlevel-image->mt->firstLevel];
 
                assert(srclvl->size == dstlvl->size);
                assert(srclvl->rowstride == dstlvl->rowstride);