diff options
author | Dave Airlie <[email protected]> | 2011-11-10 13:46:25 +0000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2011-11-11 15:04:52 +0000 |
commit | beb3e81b86698359e037d49f35feba3ca53626b2 (patch) | |
tree | 6a2be2d8c01197d5bbbaac6bb8fde65bcab06326 /src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | |
parent | ba3b9fad60d156a4e3e6311b92c652b36d8969d2 (diff) |
radeon: fix bug with wrong stride being used for rectangluar textures.
This broke the meta bitmap code when it was enabled.
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c')
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index 79753540996..05daf1cec43 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -96,14 +96,14 @@ unsigned get_texture_image_size( return rowStride * height * depth; } -unsigned get_texture_image_row_stride(radeonContextPtr rmesa, gl_format format, unsigned width, unsigned tiling) +unsigned get_texture_image_row_stride(radeonContextPtr rmesa, gl_format format, unsigned width, unsigned tiling, GLuint target) { if (_mesa_is_format_compressed(format)) { return get_aligned_compressed_row_stride(format, width, rmesa->texture_compressed_row_align); } else { unsigned row_align; - if (!_mesa_is_pow_two(width)) { + if (!_mesa_is_pow_two(width) || target == GL_TEXTURE_RECTANGLE) { row_align = rmesa->texture_rect_row_align - 1; } else if (tiling) { unsigned tileWidth, tileHeight; @@ -132,7 +132,7 @@ static void compute_tex_image_offset(radeonContextPtr rmesa, radeon_mipmap_tree height = _mesa_next_pow_two_32(lvl->height); - lvl->rowstride = get_texture_image_row_stride(rmesa, mt->mesaFormat, lvl->width, mt->tilebits); + lvl->rowstride = get_texture_image_row_stride(rmesa, mt->mesaFormat, lvl->width, mt->tilebits, mt->target); lvl->size = get_texture_image_size(mt->mesaFormat, lvl->rowstride, height, lvl->depth, mt->tilebits); assert(lvl->size > 0); |