[Mesa-dev] [PATCH 1/6] intel: Don't consider miptrees for other texture targets to match.

Eric Anholt eric at anholt.net
Wed Dec 21 15:33:04 PST 2011


We would have done a relayout at validate time, but it's senseless to
store into a miptree if it's going to force relayout.
---
 src/mesa/drivers/dri/intel/intel_mipmap_tree.c  |    3 +++
 src/mesa/drivers/dri/intel/intel_tex_validate.c |    1 -
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index e0f9632..9e0f201 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -333,6 +333,9 @@ intel_miptree_match_image(struct intel_mipmap_tree *mt,
    GLuint level = intelImage->base.Base.Level;
    int width, height, depth;
 
+   if (target_to_target(image->TexObject->Target) != mt->target)
+      return false;
+
    if (image->TexFormat != mt->format &&
        !(image->TexFormat == MESA_FORMAT_S8_Z24 &&
 	 mt->format == MESA_FORMAT_X8_Z24 &&
diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c
index b0daa2c..63938dd 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_validate.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c
@@ -62,7 +62,6 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
     */
    if (intelObj->mt &&
        (!intel_miptree_match_image(intelObj->mt, &firstImage->base.Base) ||
-	intelObj->mt->target != intelObj->base.Target ||
 	intelObj->mt->first_level != tObj->BaseLevel ||
 	intelObj->mt->last_level < intelObj->_MaxLevel)) {
       intel_miptree_release(&intelObj->mt);
-- 
1.7.7.3



More information about the mesa-dev mailing list