From: Maciej Cencora Date: Mon, 7 Dec 2009 21:24:41 +0000 (+0100) Subject: radeon: fix cases when only first image where put directly into miptree. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9921b3048e611398460ef774355b7515bc901240;p=mesa.git radeon: fix cases when only first image where put directly into miptree. Make sure that minimal width, height and depth of texture image is 1. --- diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 00e0658dc54..28690325d12 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -524,9 +524,9 @@ static int image_matches_texture_obj(struct gl_texture_object *texObj, return 0; const unsigned levelDiff = level - texObj->BaseLevel; - const unsigned refWidth = baseImage->Width >> levelDiff; - const unsigned refHeight = baseImage->Height >> levelDiff; - const unsigned refDepth = baseImage->Depth >> levelDiff; + const unsigned refWidth = MAX2(baseImage->Width >> levelDiff, 1); + const unsigned refHeight = MAX2(baseImage->Height >> levelDiff, 1); + const unsigned refDepth = MAX2(baseImage->Depth >> levelDiff, 1); return (texImage->Width == refWidth && texImage->Height == refHeight &&