i915: Fix NPOT compressed textures on 915.
[mesa.git] / src / mesa / drivers / dri / i915 / i915_tex_layout.c
index 6e4512129cd1c87628ec7a13a1dfc15cc91c9671..e6a471162239a4ac21676b8c9c27743b6c21c561 100644 (file)
@@ -219,9 +219,9 @@ i915_miptree_layout_2d(struct intel_context *intel,
                                   width, height, 1);
 
       if (mt->compressed)
-        img_height = MAX2(1, height / 4);
+        img_height = ALIGN(height, 4) / 4;
       else
-        img_height = (MAX2(2, height) + 1) & ~1;
+        img_height = ALIGN(height, 2);
 
       mt->total_height += img_height;