Mesa (mesa_7_7_branch): radeon: fix cases when only first image where put directly into miptree.
Maciej Cencora
osiris at kemper.freedesktop.org
Mon Dec 7 21:30:46 UTC 2009
Module: Mesa
Branch: mesa_7_7_branch
Commit: f7f2318243b83cd61af1c1de96e8c707ad361693
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f7f2318243b83cd61af1c1de96e8c707ad361693
Author: Maciej Cencora <m.cencora at gmail.com>
Date: Mon Dec 7 22:24:41 2009 +0100
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.
---
src/mesa/drivers/dri/radeon/radeon_texture.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c
index 00e0658..84afce8 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 = MIN2(baseImage->Width >> levelDiff, 1);
+ const unsigned refHeight = MIN2(baseImage->Height >> levelDiff, 1);
+ const unsigned refDepth = MIN2(baseImage->Depth >> levelDiff, 1);
return (texImage->Width == refWidth &&
texImage->Height == refHeight &&
More information about the mesa-commit
mailing list