intel: Don't consider miptrees for other texture targets to match.
authorEric Anholt <eric@anholt.net>
Wed, 21 Dec 2011 23:15:09 +0000 (15:15 -0800)
committerEric Anholt <eric@anholt.net>
Thu, 29 Dec 2011 17:33:56 +0000 (09:33 -0800)
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
src/mesa/drivers/dri/intel/intel_tex_validate.c

index e0f9632838b56131ba5b6e25ded2d5908aef4bb8..9e0f20145561b5d4d8006c8ca58212ba2c055f0b 100644 (file)
@@ -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 &&
index b0daa2c4de3c09ad260cbc0dcb943ec8a52954d1..63938dd4fe23ac1832aa79d849ee817f72573c53 100644 (file)
@@ -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);