From 3ad9c551b95c6fd8787f6f007bda34df446b53ab Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Sat, 19 May 2007 00:45:38 +0200 Subject: fix small s3tc mipmaps (#10968) make sure that always whole blocks are uploaded. (May still not work correctly if the top mip map is not at least a full block, that is 4 pixels wide - not sure, but probably doesn't happen in real world) --- src/mesa/drivers/dri/i915/i915_texstate.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/mesa/drivers/dri/i915/i915_texstate.c') diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index 3b639e7144..9f0c9491b2 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -172,12 +172,8 @@ static void i915LayoutTextureImages( i915ContextPtr i915, t->intel.image[0][i].offset = total_height * pitch; t->intel.image[0][i].internalFormat = baseImage->_BaseFormat; - if (t->intel.image[0][i].image->IsCompressed) - { - if (t->intel.image[0][i].image->Height > 4) - total_height += t->intel.image[0][i].image->Height/4; - else - total_height += 1; + if (t->intel.image[0][i].image->IsCompressed) { + total_height += (t->intel.image[0][i].image->Height + 3) / 4; } else total_height += MAX2(2, t->intel.image[0][i].image->Height); -- cgit v1.2.3