intel: Fix miptree height alignment for compressed NPOT textures.
authorEric Anholt <eric@anholt.net>
Fri, 10 Jun 2011 00:04:12 +0000 (17:04 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 14 Jun 2011 18:17:39 +0000 (11:17 -0700)
This is effectively just "round up when dividing by 4" compared to the
previous code.  Fixes the broken stripe at the top of
fbo-generatemipmap-formats GL_EXT_texture_compression_rgtc.

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

index 91ee55e2237910c96701148e9e0c2dee075f0a93..9d8152375d8317743e71cf68498428c3f00b9c3a 100644 (file)
@@ -97,11 +97,9 @@ void i945_miptree_layout_2d(struct intel_context *intel,
       intel_miptree_set_level_info(mt, level, nr_images, x, y, width,
                                   height, 1);
 
+      img_height = ALIGN(height, align_h);
       if (mt->compressed)
-        img_height = MAX2(1, height/4);
-      else
-        img_height = ALIGN(height, align_h);
-
+        img_height /= align_h;
 
       /* Because the images are packed better, the final offset
        * might not be the maximal one: