From eb6418b8952f335b6cf58232b5f282fc3e325c7a Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Sat, 19 May 2007 04:38:55 +0200 Subject: 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). --- src/mesa/drivers/dri/i915tex/i915_tex_layout.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/mesa/drivers/dri/i915tex/i915_tex_layout.c') diff --git a/src/mesa/drivers/dri/i915tex/i915_tex_layout.c b/src/mesa/drivers/dri/i915tex/i915_tex_layout.c index 2e1600cfdf..9f40706c36 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); -- cgit v1.2.3