From 0fac09a87c07d09dcd915c02b831505a53b02153 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 9 Jun 2011 10:00:59 -0700 Subject: [PATCH] intel: Make the intel_miptree_match_image format check more specific. We don't care just about the internalFormat/cpp/compressed, but about the specific format chosen. We have no support for format translations as part of texture validation, and furthermore it has restrictions in the GL specification. However, we should be making consistent decisions for this check anyway. --- src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 9 +-------- src/mesa/drivers/dri/intel/intel_tex_validate.c | 6 ++---- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index c8ad1a7d34d..c190f0fb789 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -227,7 +227,6 @@ GLboolean intel_miptree_match_image(struct intel_mipmap_tree *mt, struct gl_texture_image *image) { - GLboolean isCompressed = _mesa_is_format_compressed(image->TexFormat); struct intel_texture_image *intelImage = intel_texture_image(image); GLuint level = intelImage->level; @@ -235,13 +234,7 @@ intel_miptree_match_image(struct intel_mipmap_tree *mt, if (image->Border) return GL_FALSE; - if (image->InternalFormat != mt->internal_format || - isCompressed != mt->compressed) - return GL_FALSE; - - if (!isCompressed && - !mt->compressed && - _mesa_get_format_bytes(image->TexFormat) != mt->cpp) + if (image->TexFormat != mt->format) return GL_FALSE; /* Test image dimensions against the base level image adjusted for diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c index fea61621dd0..e833c15af5c 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_validate.c +++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c @@ -118,14 +118,12 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) */ if (intelObj->mt && (intelObj->mt->target != intelObj->base.Target || - intelObj->mt->internal_format != firstImage->base.InternalFormat || + intelObj->mt->format != firstImage->base.TexFormat || intelObj->mt->first_level != tObj->BaseLevel || intelObj->mt->last_level < intelObj->_MaxLevel || intelObj->mt->width0 != firstImage->base.Width || intelObj->mt->height0 != firstImage->base.Height || - intelObj->mt->depth0 != firstImage->base.Depth || - intelObj->mt->cpp != cpp || - intelObj->mt->compressed != _mesa_is_format_compressed(firstImage->base.TexFormat))) { + intelObj->mt->depth0 != firstImage->base.Depth)) { intel_miptree_release(intel, &intelObj->mt); } -- 2.30.2