intel: Don't tile textures so small that size is blown up by over 2x.
authorEric Anholt <eric@anholt.net>
Wed, 5 May 2010 04:19:55 +0000 (21:19 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 5 May 2010 05:06:12 +0000 (22:06 -0700)
Noted on the mailing list for an app that puts each glyph for its text
into a separate texture.

src/mesa/drivers/dri/intel/intel_mipmap_tree.c

index ef1966ea7e14c0136e87a1ec3bb59df08b38d7e0..71ef7a8e39b6d6b23ea9875239bb13c99ea27a1c 100644 (file)
@@ -116,17 +116,16 @@ intel_miptree_create(struct intel_context *intel,
                     GLboolean expect_accelerated_upload)
 {
    struct intel_mipmap_tree *mt;
-   uint32_t tiling;
+   uint32_t tiling = I915_TILING_NONE;
 
    if (intel->use_texture_tiling && compress_byte == 0) {
       if (intel->gen >= 4 &&
          (base_format == GL_DEPTH_COMPONENT ||
           base_format == GL_DEPTH_STENCIL_EXT))
         tiling = I915_TILING_Y;
-      else
+      else if (width0 >= 64)
         tiling = I915_TILING_X;
-   } else
-      tiling = I915_TILING_NONE;
+   }
 
    mt = intel_miptree_create_internal(intel, target, internal_format,
                                      first_level, last_level, width0,