nv50: align pitch of linear surfaces correctly
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Tue, 30 Aug 2011 11:06:03 +0000 (13:06 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Tue, 30 Aug 2011 11:55:07 +0000 (13:55 +0200)
src/gallium/drivers/nv50/nv50_miptree.c

index bc81604508b3a92cc62b3d2daabef0695fdd8e5a..3537681d4d70f6c04f0605756446c04061a56209 100644 (file)
@@ -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;