summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv10/nv10_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/nv10/nv10_miptree.c
parentcc8e628563a1cfb26752bc014a75f3087cd8986d (diff)
nouveau: adapt to cpp->pf_block changes
Diffstat (limited to 'src/gallium/drivers/nv10/nv10_miptree.c')
-rw-r--r--src/gallium/drivers/nv10/nv10_miptree.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/drivers/nv10/nv10_miptree.c b/src/gallium/drivers/nv10/nv10_miptree.c
index 1b9947354d6..f1486a35df5 100644
--- a/src/gallium/drivers/nv10/nv10_miptree.c
+++ b/src/gallium/drivers/nv10/nv10_miptree.c
@@ -25,11 +25,13 @@ nv10_miptree_layout(struct nv10_miptree *nv10mt)
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)
- nv10mt->level[l].pitch = pt->width[l] * pt->cpp;
+ nv10mt->level[l].pitch = pt->nblocksx[l] * pt->block.size;
else
- nv10mt->level[l].pitch = pt->width[0] * pt->cpp;
+ nv10mt->level[l].pitch = pt->nblocksx[0] * pt->block.size;
nv10mt->level[l].pitch = (nv10mt->level[l].pitch + 63) & ~63;
nv10mt->level[l].image_offset =
@@ -117,10 +119,12 @@ nv10_miptree_surface_get(struct pipe_screen *screen, struct pipe_texture *pt,
return NULL;
pipe_buffer_reference(ws, &ps->buffer, nv10mt->buffer);
ps->format = pt->format;
- ps->cpp = pt->cpp;
ps->width = pt->width[level];
ps->height = pt->height[level];
- ps->pitch = nv10mt->level[level].pitch / ps->cpp;
+ ps->block = pt->block;
+ ps->nblocksx = pt->nblocksx[level];
+ ps->nblocksy = pt->nblocksy[level];
+ ps->stride = nv10mt->level[level].pitch;
if (pt->target == PIPE_TEXTURE_CUBE) {
ps->offset = nv10mt->level[level].image_offset[face];