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 <l.stach@pengutronix.de>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
This commit is contained in:
Lucas Stach 2017-05-18 16:30:02 +02:00
parent c3b2c7a75f
commit 6e628ee3f3

View file

@ -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);