diff options
author | Christian Gmeiner <[email protected]> | 2019-09-06 21:21:26 +0200 |
---|---|---|
committer | Christian Gmeiner <[email protected]> | 2019-10-20 09:03:06 +0000 |
commit | eab6d75066463365fb89f99ad6185e462ecb33ea (patch) | |
tree | a5433c389eec16b50e44d8a6e1776a0a535164bc /src/gallium | |
parent | cd4528563f6e57e6f73a0a8b6d4875d6f5ec0563 (diff) |
etnaviv: store updated usage in pipe_transfer object
Store the changed usage in the newly created transfer object.
Signed-off-by: Christian Gmeiner <[email protected]>
Reviewed-by: Lucas Stach <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_transfer.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_transfer.c b/src/gallium/drivers/etnaviv/etnaviv_transfer.c index ade4e877bf1..62b876f2d99 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_transfer.c +++ b/src/gallium/drivers/etnaviv/etnaviv_transfer.c @@ -199,14 +199,6 @@ etna_transfer_map(struct pipe_context *pctx, struct pipe_resource *prsc, /* slab_alloc() doesn't zero */ memset(trans, 0, sizeof(*trans)); - ptrans = &trans->base; - pipe_resource_reference(&ptrans->resource, prsc); - ptrans->level = level; - ptrans->usage = usage; - ptrans->box = *box; - - assert(level <= prsc->last_level); - /* Upgrade DISCARD_RANGE to WHOLE_RESOURCE if the whole resource is * being mapped. If we add buffer reallocation to avoid CPU/GPU sync this * check needs to be extended to coherent mappings and shared resources. @@ -221,6 +213,14 @@ etna_transfer_map(struct pipe_context *pctx, struct pipe_resource *prsc, usage |= PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE; } + ptrans = &trans->base; + pipe_resource_reference(&ptrans->resource, prsc); + ptrans->level = level; + ptrans->usage = usage; + ptrans->box = *box; + + assert(level <= prsc->last_level); + if (rsc->texture && !etna_resource_newer(rsc, etna_resource(rsc->texture))) { /* We have a texture resource which is the same age or newer than the * render resource. Use the texture resource, which avoids bouncing |