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 564da19f58e01c6d936c0bd3ab86c239d67b4329..0d87f152e99601326d792647e461b2dd4b790b14 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);