diff options
author | Marek Olšák <[email protected]> | 2010-01-16 01:45:10 +0100 |
---|---|---|
committer | Corbin Simpson <[email protected]> | 2010-01-18 02:35:08 -0800 |
commit | cd553ec8be14eea7db2d21b9f26ea6e72474a471 (patch) | |
tree | 1ed955d3b0c59415a2d50f107ae4c0a0ecdba441 /src/gallium | |
parent | 064eb0a095b1ac56e20459c216c9271bef01cb9f (diff) |
r300g: do not align compressed textures to a tile size
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/r300/r300_texture.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index c6dd27272b6..1f73f74c268 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -139,11 +139,15 @@ unsigned r300_texture_get_stride(struct r300_screen* screen, return 0; } - tile_width = r300_texture_get_tile_size(tex, TILE_WIDTH); - width = align(u_minify(tex->tex.width0, level), tile_width); + width = u_minify(tex->tex.width0, level); - /* Should already be aligned except for S3TC. */ - return align(util_format_get_stride(tex->tex.format, width), 32); + if (!util_format_is_compressed(tex->tex.format)) { + tile_width = r300_texture_get_tile_size(tex, TILE_WIDTH); + width = align(width, tile_width); + return util_format_get_stride(tex->tex.format, width); + } else { + return align(util_format_get_stride(tex->tex.format, width), 32); + } } static unsigned r300_texture_get_nblocksy(struct r300_texture* tex, @@ -151,8 +155,12 @@ static unsigned r300_texture_get_nblocksy(struct r300_texture* tex, { unsigned height, tile_height; - tile_height = r300_texture_get_tile_size(tex, TILE_HEIGHT); - height = align(u_minify(tex->tex.height0, level), tile_height); + height = u_minify(tex->tex.height0, level); + + if (!util_format_is_compressed(tex->tex.format)) { + tile_height = r300_texture_get_tile_size(tex, TILE_HEIGHT); + height = align(height, tile_height); + } return util_format_get_nblocksy(tex->tex.format, height); } |