summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv40
diff options
context:
space:
mode:
authorYounes Manton <[email protected]>2008-12-02 16:12:49 -0500
committerYounes Manton <[email protected]>2008-12-02 16:15:13 -0500
commit4371a24c320f3d26f07effa0c3e862078762c942 (patch)
treedf7288893407c18509ccf064b2d2702f668a7bf9 /src/gallium/drivers/nv40
parent25eee19cd6e13b6682f4078681a367849c4a0fd5 (diff)
nouveau: Calc pitch for swizzled textures appropriately.
Diffstat (limited to 'src/gallium/drivers/nv40')
-rw-r--r--src/gallium/drivers/nv40/nv40_miptree.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gallium/drivers/nv40/nv40_miptree.c b/src/gallium/drivers/nv40/nv40_miptree.c
index 6516bff4b81..b68967c07fd 100644
--- a/src/gallium/drivers/nv40/nv40_miptree.c
+++ b/src/gallium/drivers/nv40/nv40_miptree.c
@@ -8,7 +8,6 @@ static void
nv40_miptree_layout(struct nv40_miptree *mt)
{
struct pipe_texture *pt = &mt->base;
- boolean swizzled = FALSE;
uint width = pt->width[0], height = pt->height[0], depth = pt->depth[0];
uint offset = 0;
int nr_faces, l, f, pitch;
@@ -30,7 +29,7 @@ nv40_miptree_layout(struct nv40_miptree *mt)
pt->nblocksx[l] = pf_get_nblocksx(&pt->block, width);
pt->nblocksy[l] = pf_get_nblocksy(&pt->block, height);
- if (swizzled)
+ if (!(pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR))
pitch = pt->nblocksx[l];
pitch = align(pitch, 64);
@@ -68,8 +67,6 @@ nv40_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
mt->shadow_tex = NULL;
mt->shadow_surface = NULL;
- nv40_miptree_layout(mt);
-
/* Swizzled textures must be POT */
if (pt->width[0] & (pt->width[0] - 1) ||
pt->height[0] & (pt->height[0] - 1))
@@ -91,6 +88,8 @@ nv40_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
}
}
+ nv40_miptree_layout(mt);
+
mt->buffer = ws->buffer_create(ws, 256,
PIPE_BUFFER_USAGE_PIXEL |
NOUVEAU_BUFFER_USAGE_TEXTURE,