summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv10
diff options
context:
space:
mode:
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 1b9947354d..f1486a35df 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 41422c8882..d21368d33f 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;