summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv30/nv30_miptree.c
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2008-06-29 13:26:04 +1000
committerBen Skeggs <[email protected]>2008-06-29 15:00:28 +1000
commitb6478021d572d9ec30212d6e6992496ee4cf347d (patch)
tree99fd64089ed7dff15f5a6a7c60c17f4bad3a3e45 /src/gallium/drivers/nv30/nv30_miptree.c
parentcc8e628563a1cfb26752bc014a75f3087cd8986d (diff)
nouveau: adapt to cpp->pf_block changes
Diffstat (limited to 'src/gallium/drivers/nv30/nv30_miptree.c')
-rw-r--r--src/gallium/drivers/nv30/nv30_miptree.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c
index 6078b1865e2..ad0b257fe2b 100644
--- a/src/gallium/drivers/nv30/nv30_miptree.c
+++ b/src/gallium/drivers/nv30/nv30_miptree.c
@@ -28,12 +28,14 @@ nv30_miptree_layout(struct nv30_miptree *nv30mt)
pt->width[l] = width;
pt->height[l] = height;
pt->depth[l] = depth;
+ pt->nblocksx[l] = pf_get_nblocksx(&pt->block, width);
+ pt->nblocksy[l] = pf_get_nblocksy(&pt->block, height);
if (swizzled)
pitch = pt->width[l];
pitch = (pitch + 63) & ~63;
- nv30mt->level[l].pitch = pitch * pt->cpp;
+ nv30mt->level[l].pitch = pitch * pt->block.size;
nv30mt->level[l].image_offset =
CALLOC(nr_faces, sizeof(unsigned));
@@ -114,10 +116,12 @@ nv30_miptree_surface_new(struct pipe_screen *pscreen, struct pipe_texture *pt,
return NULL;
pipe_buffer_reference(ws, &ps->buffer, nv30mt->buffer);
ps->format = pt->format;
- ps->cpp = pt->cpp;
ps->width = pt->width[level];
ps->height = pt->height[level];
- ps->pitch = nv30mt->level[level].pitch / ps->cpp;
+ ps->nblocksx = pt->nblocksx[level];
+ ps->nblocksy = pt->nblocksy[level];
+ ps->block = pt->block;
+ ps->stride = nv30mt->level[level].pitch;
if (pt->target == PIPE_TEXTURE_CUBE) {
ps->offset = nv30mt->level[level].image_offset[face];