aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2007-05-19 04:38:55 +0200
committerRoland Scheidegger <[email protected]>2007-05-19 04:38:55 +0200
commiteb6418b8952f335b6cf58232b5f282fc3e325c7a (patch)
tree8f98d5acb28839f5e552339ca7e9c977ba01b0cc
parent25551bdfad8541337a4e59e7e3764fa9b876cb19 (diff)
fix miptree layout (i915) for small compressed mipmaps
This seems to work now. Also fix i945 set_level_info, need to match i915 behaviour for storing mip height, as it's assumed to be the mip width (in texels) elsewhere and the division by 4 is done later (untested).
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_tex_layout.c4
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_layout.c2
2 files changed, 2 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i915tex/i915_tex_layout.c b/src/mesa/drivers/dri/i915tex/i915_tex_layout.c
index 2e1600cfdfa..9f40706c36a 100644
--- a/src/mesa/drivers/dri/i915tex/i915_tex_layout.c
+++ b/src/mesa/drivers/dri/i915tex/i915_tex_layout.c
@@ -161,11 +161,9 @@ i915_miptree_layout(struct intel_mipmap_tree * mt)
if (mt->compressed)
img_height = MAX2(1, height / 4);
else
- img_height = MAX2(2, height);
+ img_height = (MAX2(2, height) + 1) & ~1;
mt->total_height += img_height;
- mt->total_height += 1;
- mt->total_height &= ~1;
width = minify(width);
height = minify(height);
diff --git a/src/mesa/drivers/dri/intel/intel_tex_layout.c b/src/mesa/drivers/dri/intel/intel_tex_layout.c
index f3564802171..fcb5cc39068 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_layout.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_layout.c
@@ -74,7 +74,7 @@ void i945_miptree_layout_2d( struct intel_mipmap_tree *mt )
GLuint img_height;
intel_miptree_set_level_info(mt, level, 1, x, y, width,
- mt->compressed ? height/4 : height, 1);
+ height, 1);
if (mt->compressed)
img_height = MAX2(1, height/4);