summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv10
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
parentcc8e628563a1cfb26752bc014a75f3087cd8986d (diff)
nouveau: adapt to cpp->pf_block changes
Diffstat (limited to 'src/gallium/drivers/nv10')
-rw-r--r--src/gallium/drivers/nv10/nv10_miptree.c12
-rw-r--r--src/gallium/drivers/nv10/nv10_state_emit.c4
2 files changed, 10 insertions, 6 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];
diff --git a/src/gallium/drivers/nv10/nv10_state_emit.c b/src/gallium/drivers/nv10/nv10_state_emit.c
index 41422c88825..d21368d33f3 100644
--- a/src/gallium/drivers/nv10/nv10_state_emit.c
+++ b/src/gallium/drivers/nv10/nv10_state_emit.c
@@ -143,10 +143,10 @@ static void nv10_state_emit_framebuffer(struct nv10_context* nv10)
if (zeta) {
BEGIN_RING(celsius, NV10TCL_RT_PITCH, 1);
- OUT_RING ( (rt->pitch * rt->cpp) | ( (zeta->pitch * zeta->cpp) << 16) );
+ OUT_RING (rt->stride | (zeta->stride << 16));
} else {
BEGIN_RING(celsius, NV10TCL_RT_PITCH, 1);
- OUT_RING ( (rt->pitch * rt->cpp) | ( (rt->pitch * rt->cpp) << 16) );
+ OUT_RING (rt->stride | (rt->stride << 16));
}
nv10->rt[0] = rt->buffer;