dri: Take the base image size into account when computing
authorXiang, Haihao <haihao.xiang@intel.com>
Tue, 1 Jul 2008 03:38:07 +0000 (11:38 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Tue, 1 Jul 2008 03:50:50 +0000 (11:50 +0800)
first level of the mipmap.  fix #16210

src/mesa/drivers/dri/common/texmem.c
src/mesa/drivers/dri/intel/intel_tex_validate.c

index b0e8c4c1c2824c871168bfbfd8862c21fd1b586b..caabac3448f268cf98d111e0fff15aa56cf28058 100644 (file)
@@ -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);
index d260a721d9a1d2d47a7d1118794559be09205c99..992c75c519dc3914b3990b62eef3eeedf7cbb3dd 100644 (file)
@@ -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);