intel: test cpp to ensure mipmap tree matches texture image.
authorXiang, Haihao <haihao.xiang@intel.com>
Wed, 30 Apr 2008 08:27:52 +0000 (16:27 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Wed, 30 Apr 2008 08:27:52 +0000 (16:27 +0800)
src/mesa/drivers/dri/intel/intel_mipmap_tree.c

index 55503f45ae89c47375f1ffa8ec9c7aac644e632e..9205627813c956af5bd3228a1f8640ef92733ea3 100644 (file)
@@ -272,6 +272,11 @@ intel_miptree_match_image(struct intel_mipmap_tree *mt,
        image->IsCompressed != mt->compressed)
       return GL_FALSE;
 
+   if (!image->IsCompressed &&
+       !mt->compressed &&
+       image->TexFormat->TexelBytes != mt->cpp)
+      return GL_FALSE;
+
    /* Test image dimensions against the base level image adjusted for
     * minification.  This will also catch images not present in the
     * tree, changed targets, etc.