llvmpipe: fix texture image size calculation
authorBrian Paul <brianp@vmware.com>
Tue, 11 May 2010 17:48:35 +0000 (11:48 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 11 May 2010 17:52:06 +0000 (11:52 -0600)
We were allocating too much memory for linear layouts.  The block_size
factor is already included in the row_stride and should not be used in
the img_stride calculation.  This is typically a 4x savings!

src/gallium/drivers/llvmpipe/lp_texture.c

index 9129fa46baf1d6998dc1f405c04dce19eab1d469..4eed687ac714b48519a2d3a5ae66492266a0089c 100644 (file)
@@ -134,7 +134,7 @@ llvmpipe_texture_layout(struct llvmpipe_screen *screen,
 
          lpr->row_stride[level] = align(nblocksx * block_size, 16);
 
-         lpr->img_stride[level] = lpr->row_stride[level] * nblocksy * block_size;
+         lpr->img_stride[level] = lpr->row_stride[level] * nblocksy;
       }
 
       /* Size of the image in tiles (for tiled layout) */