summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXiang, Haihao <[email protected]>2008-07-01 11:38:07 +0800
committerXiang, Haihao <[email protected]>2008-07-01 11:50:50 +0800
commitbcc2a3d7e3c5f81bb5a45b8d628a133f3b5499a5 (patch)
tree4ac632c71281fe2022b7937f3d7f510f65180f38 /src
parent5cae1b747bf7013124c21f15c410635c16593656 (diff)
dri: Take the base image size into account when computing
first level of the mipmap. fix #16210
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/common/texmem.c1
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_validate.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/common/texmem.c b/src/mesa/drivers/dri/common/texmem.c
index b0e8c4c1c28..caabac3448f 100644
--- a/src/mesa/drivers/dri/common/texmem.c
+++ b/src/mesa/drivers/dri/common/texmem.c
@@ -1278,6 +1278,7 @@ driCalculateTextureFirstLastLevel( driTextureObject * t )
else {
firstLevel = tObj->BaseLevel + (GLint)(tObj->MinLod + 0.5);
firstLevel = MAX2(firstLevel, tObj->BaseLevel);
+ firstLevel = MIN2(firstLevel, tObj->BaseLevel + baseImage->MaxLog2);
lastLevel = tObj->BaseLevel + (GLint)(tObj->MaxLod + 0.5);
lastLevel = MAX2(lastLevel, t->tObj->BaseLevel);
lastLevel = MIN2(lastLevel, t->tObj->BaseLevel + baseImage->MaxLog2);
diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c
index d260a721d9a..992c75c519d 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_validate.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c
@@ -43,6 +43,7 @@ intel_calculate_first_last_level(struct intel_texture_object *intelObj)
#ifdef I915
firstLevel = tObj->BaseLevel + (GLint) (tObj->MinLod + 0.5);
firstLevel = MAX2(firstLevel, tObj->BaseLevel);
+ firstLevel = MIN2(firstLevel, tObj->BaseLevel + baseImage->MaxLog2);
lastLevel = tObj->BaseLevel + (GLint) (tObj->MaxLod + 0.5);
lastLevel = MAX2(lastLevel, tObj->BaseLevel);
lastLevel = MIN2(lastLevel, tObj->BaseLevel + baseImage->MaxLog2);