[Mesa-dev] [PATCH 11/11] intel: Fix miptree height alignment for compressed NPOT textures.

Eric Anholt eric at anholt.net
Fri Jun 10 13:38:23 PDT 2011


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 |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_tex_layout.c b/src/mesa/drivers/dri/intel/intel_tex_layout.c
index 2002777..934af16 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_layout.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_layout.c
@@ -100,11 +100,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 + 3/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:
-- 
1.7.5.3



More information about the mesa-dev mailing list