diff options
author | Christoph Bumiller <[email protected]> | 2011-03-05 00:05:14 +0100 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2011-03-05 00:51:07 +0100 |
commit | 4fae7da9a3a3849ca08ffc6fcbdccc6a9c065ad2 (patch) | |
tree | 7984f66e7203617e7cb43924db4727ff4370036f /src/gallium/drivers/nvc0/nvc0_transfer.c | |
parent | 9f0acfe1384d3236ac30ffca4be96e9531d2e876 (diff) |
nv50,nvc0: fix texture layer issues
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_transfer.c')
-rw-r--r-- | src/gallium/drivers/nvc0/nvc0_transfer.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_transfer.c b/src/gallium/drivers/nvc0/nvc0_transfer.c index a38bdb8f0a6..bc642669e5b 100644 --- a/src/gallium/drivers/nvc0/nvc0_transfer.c +++ b/src/gallium/drivers/nvc0/nvc0_transfer.c @@ -243,35 +243,23 @@ nvc0_miptree_transfer_new(struct pipe_context *pctx, struct nvc0_miptree_level *lvl = &mt->level[level]; struct nvc0_transfer *tx; uint32_t size; - uint32_t w, h, d, z, layer, box_h, box_y; + uint32_t w, h, d, z, layer; int ret; tx = CALLOC_STRUCT(nvc0_transfer); if (!tx) return NULL; - box_y = box->y; - box_h = box->height; - if (mt->layout_3d) { z = box->z; d = u_minify(res->depth0, level); layer = 0; - tx->nlayers = box->depth; } else { z = 0; d = 1; - if (res->target == PIPE_TEXTURE_1D || - res->target == PIPE_TEXTURE_1D_ARRAY) { - box_y = 0; - box_h = 1; - layer = box->y; - tx->nlayers = box->height; - } else { - layer = box->z; - tx->nlayers = box->depth; - } + layer = box->z; } + tx->nlayers = box->depth; pipe_resource_reference(&tx->base.resource, res); @@ -280,7 +268,7 @@ nvc0_miptree_transfer_new(struct pipe_context *pctx, tx->base.box = *box; tx->nblocksx = util_format_get_nblocksx(res->format, box->width); - tx->nblocksy = util_format_get_nblocksy(res->format, box_h); + tx->nblocksy = util_format_get_nblocksy(res->format, box->height); tx->base.stride = tx->nblocksx * util_format_get_blocksize(res->format); tx->base.layer_stride = tx->nblocksy * tx->base.stride; @@ -294,7 +282,7 @@ nvc0_miptree_transfer_new(struct pipe_context *pctx, tx->rect[0].base = lvl->offset + layer * mt->layer_stride; tx->rect[0].tile_mode = lvl->tile_mode; tx->rect[0].x = util_format_get_nblocksx(res->format, box->x); - tx->rect[0].y = util_format_get_nblocksy(res->format, box_y); + tx->rect[0].y = util_format_get_nblocksy(res->format, box->y); tx->rect[0].z = z; tx->rect[0].width = util_format_get_nblocksx(res->format, w); tx->rect[0].height = util_format_get_nblocksy(res->format, h); |