summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/radeon/radeon_texture.c
diff options
context:
space:
mode:
authorAndre Maasikas <amaasikas@gmail.com>2009-12-08 11:57:24 +0200
committerAndre Maasikas <amaasikas@gmail.com>2009-12-08 11:57:24 +0200
commitb5e256c76dea2182c82af2a4f66224735701d55a (patch)
tree42ab2283fc94ab3deefc30983aaa10f283897dd6 /src/mesa/drivers/dri/radeon/radeon_texture.c
parentac66598ed8bc218720cf2a1a7493b7e25ca9d962 (diff)
parent0d4a05445c6b47b93269a3829afbe509ffec4817 (diff)
Merge branch 'mesa_7_7_branch'
Conflicts: src/mesa/drivers/dri/r600/r700_assembler.c src/mesa/main/version.h
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_texture.c')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_texture.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c
index 0390d376ba..28690325d1 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.c
@@ -515,15 +515,18 @@ static int image_matches_texture_obj(struct gl_texture_object *texObj,
struct gl_texture_image *texImage,
unsigned level)
{
- const struct gl_texture_image *baseImage = texObj->Image[0][level];
+ const struct gl_texture_image *baseImage = texObj->Image[0][texObj->BaseLevel];
+
+ if (!baseImage)
+ return 0;
if (level < texObj->BaseLevel || level > texObj->MaxLevel)
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 &&