Mesa (radeon-rewrite): radeon: fix mipmap_limits crasher.

Dave Airlie airlied at kemper.freedesktop.org
Mon Jun 8 20:58:27 PDT 2009


Module: Mesa
Branch: radeon-rewrite
Commit: 18b3cbcede292ce7b90b818b6abb064869072ff3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=18b3cbcede292ce7b90b818b6abb064869072ff3

Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Jun  9 13:52:58 2009 +1000

radeon: fix mipmap_limits crasher.

This gets the correct srclvl image map when uploading images to the new mipmap.

---

 src/mesa/drivers/dri/radeon/radeon_texture.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c
index 564da19..0d87f15 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.c
@@ -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);



More information about the mesa-commit mailing list