From: Maciej Cencora Date: Sun, 29 Nov 2009 11:36:09 +0000 (+0100) Subject: radeon: don't check the same miptree many times when looking for matching miptrees X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2773556d55fe6043bee3d4c86f7b78906e5d60e0;p=mesa.git radeon: don't check the same miptree many times when looking for matching miptrees --- diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index d0b96912048..39b6d50094e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -506,7 +506,7 @@ static radeon_mipmap_tree * get_biggest_matching_miptree(radeonTexObj *texObj, if (!img) break; - if (!img->mt || !radeon_miptree_matches_texture(img->mt, &texObj->base)) + if (!img->mt) continue; for (int i = 0; i < mtCount; ++i) { @@ -517,8 +517,8 @@ static radeon_mipmap_tree * get_biggest_matching_miptree(radeonTexObj *texObj, } } - if (!found) { - mtSizes[mtCount] += img->mt->levels[img->mtlevel].size; + if (!found && radeon_miptree_matches_texture(img->mt, &texObj->base)) { + mtSizes[mtCount] = img->mt->levels[img->mtlevel].size; mts[mtCount] = img->mt; mtCount++; }