nouveau: 1xN, Nx1 levels of a swizzled mip tree shouldn't be aligned.
authorYounes Manton <younes.m@gmail.com>
Wed, 11 Feb 2009 16:52:32 +0000 (11:52 -0500)
committerYounes Manton <younes.m@gmail.com>
Wed, 11 Feb 2009 16:58:35 +0000 (11:58 -0500)
src/gallium/drivers/nv30/nv30_miptree.c
src/gallium/drivers/nv40/nv40_miptree.c

index fe13f50ebb35bd1a6fb97a569fd039563d4f3899..510c94d4e644cda6d8c269147a8f8c2ba7ab1fcb 100644 (file)
@@ -50,7 +50,8 @@ nv30_miptree_layout(struct nv30_miptree *nv30mt)
                for (l = 0; l < pt->last_level; l++) {
                        nv30mt->level[l].image_offset[f] = offset;
 
-                       if (!(pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR))
+                       if (!(pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR) &&
+                           pt->width[l + 1] > 1 && pt->height[l + 1] > 1)
                                offset += align(nv30mt->level[l].pitch * pt->height[l], 64);
                        else
                                offset += nv30mt->level[l].pitch * pt->height[l];
index e4f8df910a9a6465d38c274cd78a4b417b943575..e38b1e7f5cabc54eaebc01e8d5f69b08b20a65c7 100644 (file)
@@ -50,7 +50,8 @@ nv40_miptree_layout(struct nv40_miptree *mt)
                for (l = 0; l < pt->last_level; l++) {
                        mt->level[l].image_offset[f] = offset;
 
-                       if (!(pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR))
+                       if (!(pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR) &&
+                           pt->width[l + 1] > 1 && pt->height[l + 1] > 1)
                                offset += align(mt->level[l].pitch * pt->height[l], 64);
                        else
                                offset += mt->level[l].pitch * pt->height[l];