From 048f988aeb06fa360c6c41eaa50cb96b4b86e34e Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Tue, 4 Aug 2009 10:57:47 +0200 Subject: r300g: Slightly saner initialization of some texture / transfer fields. --- src/gallium/drivers/r300/r300_texture.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/gallium/drivers/r300/r300_texture.c') diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index daf1647bee..0164f05096 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -81,13 +81,11 @@ static void r300_setup_miptree(struct r300_texture* tex) * XXX * POT, uncompressed, unmippmapped textures can be aligned to 32, * instead of 64. */ - stride = align( - (base->nblocksx[i] * base->block.size) / base->block.width, - 32); + stride = align(pf_get_stride(&base->block, base->width[i]), 32); size = stride * base->nblocksy[i] * base->depth[i]; tex->offset[i] = align(tex->size, 32); - tex->size += tex->offset[i] + size; + tex->size = tex->offset[i] + size; debug_printf("r300: Texture miptree: Level %d " "(%dx%dx%d px, pitch %d bytes)\n", -- cgit v1.2.3