diff options
author | Lucas Stach <[email protected]> | 2017-05-18 16:30:02 +0200 |
---|---|---|
committer | Lucas Stach <[email protected]> | 2017-06-08 18:29:36 +0200 |
commit | 6e628ee3f3cd250d58f1b49fc0b53db58cd8eeea (patch) | |
tree | 740469007a30f50de29992e8bc7e1932b6fe247f /src/gallium | |
parent | c3b2c7a75f1ef6306d0218d92564319d22cfc8fe (diff) |
etnaviv: don't read back resource if transfer discards contents
Reduces bandwidth usage of transfers which discard the buffer contents,
as well as skipping unnecessary command stream flushes and CPU/GPU
synchronization.
Signed-off-by: Lucas Stach <[email protected]>
Reviewed-by: Wladimir J. van der Laan <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_transfer.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_transfer.c b/src/gallium/drivers/etnaviv/etnaviv_transfer.c index 4ead6dff7f4..707029865a5 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_transfer.c +++ b/src/gallium/drivers/etnaviv/etnaviv_transfer.c @@ -197,7 +197,9 @@ etna_transfer_map(struct pipe_context *pctx, struct pipe_resource *prsc, return NULL; } - etna_copy_resource(pctx, trans->rsc, prsc, level, trans->rsc->last_level); + if (!(usage & PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE)) + etna_copy_resource(pctx, trans->rsc, prsc, level, + trans->rsc->last_level); /* Switch to using the temporary resource instead */ rsc = etna_resource(trans->rsc); |