summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv20
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2009-12-04 00:35:14 +0100
committerRoland Scheidegger <sroland@vmware.com>2009-12-04 00:35:14 +0100
commit9c6a9363ef96c00dd0ad63e340b32479e43fea45 (patch)
treec1752752623301c7bc63d25173c396794b74922d /src/gallium/drivers/nv20
parentcc8a537c57a62a196106b592e510e4c93bd1826e (diff)
parent94b5c28a98850f42fbcdab9ceda1450279e1e6fd (diff)
Merge branch 'gallium-noblocks'
Conflicts: src/gallium/state_trackers/xorg/xorg_exa.c
Diffstat (limited to 'src/gallium/drivers/nv20')
-rw-r--r--src/gallium/drivers/nv20/nv20_miptree.c10
-rw-r--r--src/gallium/drivers/nv20/nv20_transfer.c9
2 files changed, 4 insertions, 15 deletions
diff --git a/src/gallium/drivers/nv20/nv20_miptree.c b/src/gallium/drivers/nv20/nv20_miptree.c
index 554e28e47d..2bde9fb75b 100644
--- a/src/gallium/drivers/nv20/nv20_miptree.c
+++ b/src/gallium/drivers/nv20/nv20_miptree.c
@@ -10,7 +10,7 @@ static void
nv20_miptree_layout(struct nv20_miptree *nv20mt)
{
struct pipe_texture *pt = &nv20mt->base;
- uint width = pt->width0, height = pt->height0;
+ uint width = pt->width0;
uint offset = 0;
int nr_faces, l, f;
uint wide_pitch = pt->tex_usage & (PIPE_TEXTURE_USAGE_SAMPLER |
@@ -26,19 +26,15 @@ nv20_miptree_layout(struct nv20_miptree *nv20mt)
}
for (l = 0; l <= pt->last_level; l++) {
- pt->nblocksx[l] = pf_get_nblocksx(&pt->block, width);
- pt->nblocksy[l] = pf_get_nblocksy(&pt->block, height);
-
if (wide_pitch && (pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR))
- nv20mt->level[l].pitch = align(pt->width0 * pt->block.size, 64);
+ nv20mt->level[l].pitch = align(pf_get_stride(pt->format, pt->width0), 64);
else
- nv20mt->level[l].pitch = u_minify(pt->width0, l) * pt->block.size;
+ nv20mt->level[l].pitch = pf_get_stride(pt->format, width);
nv20mt->level[l].image_offset =
CALLOC(nr_faces, sizeof(unsigned));
width = u_minify(width, 1);
- height = u_minify(height, 1);
}
for (f = 0; f < nr_faces; f++) {
diff --git a/src/gallium/drivers/nv20/nv20_transfer.c b/src/gallium/drivers/nv20/nv20_transfer.c
index 87b5c14a3c..f2e0a34db9 100644
--- a/src/gallium/drivers/nv20/nv20_transfer.c
+++ b/src/gallium/drivers/nv20/nv20_transfer.c
@@ -24,9 +24,6 @@ nv20_compatible_transfer_tex(struct pipe_texture *pt, unsigned level,
template->width0 = u_minify(pt->width0, level);
template->height0 = u_minify(pt->height0, level);
template->depth0 = 1;
- template->block = pt->block;
- template->nblocksx[0] = pt->nblocksx[level];
- template->nblocksy[0] = pt->nblocksx[level];
template->last_level = 0;
template->nr_samples = pt->nr_samples;
@@ -49,14 +46,10 @@ nv20_transfer_new(struct pipe_screen *pscreen, struct pipe_texture *pt,
return NULL;
pipe_texture_reference(&tx->base.texture, pt);
- tx->base.format = pt->format;
tx->base.x = x;
tx->base.y = y;
tx->base.width = w;
tx->base.height = h;
- tx->base.block = pt->block;
- tx->base.nblocksx = pt->nblocksx[level];
- tx->base.nblocksy = pt->nblocksy[level];
tx->base.stride = mt->level[level].pitch;
tx->base.usage = usage;
tx->base.face = face;
@@ -158,7 +151,7 @@ nv20_transfer_map(struct pipe_screen *pscreen, struct pipe_transfer *ptx)
pipe_transfer_buffer_flags(ptx));
return map + ns->base.offset +
- ptx->y * ns->pitch + ptx->x * ptx->block.size;
+ ptx->y * ns->pitch + ptx->x * pf_get_blocksize(ptx->texture->format);
}
static void