Mesa (master): llvmpipe: fix texture image size calculation

Brian Paul brianp at kemper.freedesktop.org
Tue May 11 17:53:10 UTC 2010


Module: Mesa
Branch: master
Commit: 08e443a1c8218e43dcd953859843d95d9020a892
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=08e443a1c8218e43dcd953859843d95d9020a892

Author: Brian Paul <brianp at vmware.com>
Date:   Tue May 11 11:48:35 2010 -0600

llvmpipe: fix texture image size calculation

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 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c
index 9129fa4..4eed687 100644
--- a/src/gallium/drivers/llvmpipe/lp_texture.c
+++ b/src/gallium/drivers/llvmpipe/lp_texture.c
@@ -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) */




More information about the mesa-commit mailing list