diff options
author | Roland Scheidegger <sroland@tungstengraphics.com> | 2007-05-19 00:45:38 +0200 |
---|---|---|
committer | Roland Scheidegger <sroland@tungstengraphics.com> | 2007-05-19 00:59:46 +0200 |
commit | 3ad9c551b95c6fd8787f6f007bda34df446b53ab (patch) | |
tree | 4aae513b663aee7b353a117cfc6c8f762eb362e6 /src/mesa/drivers/dri/i915/i915_texstate.c | |
parent | 4fca6bfa5d211a093c54b0bbeadaa38081e8c141 (diff) |
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)
Diffstat (limited to 'src/mesa/drivers/dri/i915/i915_texstate.c')
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_texstate.c | 8 |
1 files changed, 2 insertions, 6 deletions
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); |