Mesa (master): nv50: align pitch of linear surfaces correctly

Christoph Bumiller chrisbmr at kemper.freedesktop.org
Tue Aug 30 11:57:16 UTC 2011


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

Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date:   Tue Aug 30 13:06:03 2011 +0200

nv50: align pitch of linear surfaces correctly

---

 src/gallium/drivers/nv50/nv50_miptree.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c
index bc81604..3537681 100644
--- a/src/gallium/drivers/nv50/nv50_miptree.c
+++ b/src/gallium/drivers/nv50/nv50_miptree.c
@@ -185,6 +185,7 @@ boolean
 nv50_miptree_init_layout_linear(struct nv50_miptree *mt)
 {
    struct pipe_resource *pt = &mt->base.base;
+   const unsigned blocksize = util_format_get_blocksize(pt->format);
 
    if (util_format_is_depth_or_stencil(pt->format))
       return FALSE;
@@ -194,7 +195,7 @@ nv50_miptree_init_layout_linear(struct nv50_miptree *mt)
    if (mt->ms_x | mt->ms_y)
       return FALSE;
 
-   mt->level[0].pitch = align(pt->width0, 64);
+   mt->level[0].pitch = align(pt->width0 * blocksize, 64);
 
    mt->total_size = mt->level[0].pitch * pt->height0;
 




More information about the mesa-commit mailing list