diff options
Diffstat (limited to 'src/gallium/drivers/etnaviv/etnaviv_transfer.c')
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_transfer.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_transfer.c b/src/gallium/drivers/etnaviv/etnaviv_transfer.c index 78face1ee90..de2d6ed9ba2 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_transfer.c +++ b/src/gallium/drivers/etnaviv/etnaviv_transfer.c @@ -134,11 +134,14 @@ etna_transfer_unmap(struct pipe_context *pctx, struct pipe_transfer *ptrans) struct etna_resource_level *res_level = &rsc->levels[ptrans->level]; if (rsc->layout == ETNA_LAYOUT_TILED) { - etna_texture_tile( - trans->mapped + ptrans->box.z * res_level->layer_stride, - trans->staging, ptrans->box.x, ptrans->box.y, - res_level->stride, ptrans->box.width, ptrans->box.height, - ptrans->stride, util_format_get_blocksize(rsc->base.format)); + for (unsigned z = 0; z < ptrans->box.depth; z++) { + etna_texture_tile( + trans->mapped + (ptrans->box.z + z) * res_level->layer_stride, + trans->staging + z * ptrans->layer_stride, + ptrans->box.x, ptrans->box.y, + res_level->stride, ptrans->box.width, ptrans->box.height, + ptrans->stride, util_format_get_blocksize(rsc->base.format)); + } } else if (rsc->layout == ETNA_LAYOUT_LINEAR) { util_copy_box(trans->mapped, rsc->base.format, res_level->stride, res_level->layer_stride, ptrans->box.x, @@ -240,7 +243,7 @@ etna_transfer_map(struct pipe_context *pctx, struct pipe_resource *prsc, return NULL; } - if (prsc->depth0 > 1) { + if (prsc->depth0 > 1 && rsc->ts_bo) { slab_free(&ctx->transfer_pool, trans); BUG("resource has depth >1 with tile status"); return NULL; @@ -427,11 +430,13 @@ etna_transfer_map(struct pipe_context *pctx, struct pipe_resource *prsc, if (usage & PIPE_TRANSFER_READ) { if (rsc->layout == ETNA_LAYOUT_TILED) { - etna_texture_untile(trans->staging, - trans->mapped + ptrans->box.z * res_level->layer_stride, - ptrans->box.x, ptrans->box.y, res_level->stride, - ptrans->box.width, ptrans->box.height, ptrans->stride, - util_format_get_blocksize(rsc->base.format)); + for (unsigned z = 0; z < ptrans->box.depth; z++) { + etna_texture_untile(trans->staging + z * ptrans->layer_stride, + trans->mapped + (ptrans->box.z + z) * res_level->layer_stride, + ptrans->box.x, ptrans->box.y, res_level->stride, + ptrans->box.width, ptrans->box.height, ptrans->stride, + util_format_get_blocksize(rsc->base.format)); + } } else if (rsc->layout == ETNA_LAYOUT_LINEAR) { util_copy_box(trans->staging, rsc->base.format, ptrans->stride, ptrans->layer_stride, 0, 0, 0, /* dst x,y,z */ |