[Mesa-dev] [PATCH 05/11] intel: Make the intel_miptree_match_image format check more specific.
Eric Anholt
eric at anholt.net
Fri Jun 10 13:38:17 PDT 2011
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 | 8 +-------
src/mesa/drivers/dri/intel/intel_tex_validate.c | 6 ++----
2 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index 9a1fb18..3fdb73d 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -235,13 +235,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 fea6162..e833c15 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);
}
--
1.7.5.3
More information about the mesa-dev
mailing list