summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel/intel_tex_validate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_tex_validate.c')
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_validate.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c
index b5803fb813..9fe4aac149 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);
@@ -140,7 +141,10 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
/* Fallback case:
*/
- if (firstImage->base.Border) {
+ if (firstImage->base.Border ||
+ ((firstImage->base._BaseFormat == GL_DEPTH_COMPONENT) &&
+ ((tObj->WrapS == GL_CLAMP_TO_BORDER) ||
+ (tObj->WrapT == GL_CLAMP_TO_BORDER)))) {
if (intelObj->mt) {
intel_miptree_release(intel, &intelObj->mt);
}