Mesa (7.11): i915: Fix NPOT compressed textures on 915.
Eric Anholt
anholt at kemper.freedesktop.org
Wed Jul 13 20:24:49 UTC 2011
Module: Mesa
Branch: 7.11
Commit: 9279c1e55679ff404c296b5a6a23c8d002e63ac3
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9279c1e55679ff404c296b5a6a23c8d002e63ac3
Author: Eric Anholt <eric at anholt.net>
Date: Mon Jul 11 16:50:06 2011 -0700
i915: Fix NPOT compressed textures on 915.
We were failing at rounding, misplacing the non-baselevels. Fixes:
3DFX_texture_compression_FXT1/fbo-generate-mipmaps
ARB_texture_compression/fbo-generate-mipmaps
EXT_texture_compression_s3tc/fbo-generate-mipmaps
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
(cherry picked from commit f2fd0d63046c41559c5dfca9ebdc5d33c0ae4177)
---
src/mesa/drivers/dri/i915/i915_tex_layout.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/mesa/drivers/dri/i915/i915_tex_layout.c b/src/mesa/drivers/dri/i915/i915_tex_layout.c
index 6e45121..e6a4711 100644
--- a/src/mesa/drivers/dri/i915/i915_tex_layout.c
+++ b/src/mesa/drivers/dri/i915/i915_tex_layout.c
@@ -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;
More information about the mesa-commit
mailing list