summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2019-04-04 16:50:18 +0200
committerErik Faye-Lund <[email protected]>2019-04-17 07:27:08 +0000
commitb08e73308ec23399def414c6f6d5020496ffda9a (patch)
treec9746eeda1fb5d09c4b66183f0f412c0f41a0138
parent7dd601a39911d8c3d0b3592ce5a24a45857b9c3b (diff)
virgl: simplify virgl_texture_transfer_unmap logic
There's no reason to keep an extra indentation level here, let's merge the two if-conditions. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Gurchetan Singh <[email protected]>
-rw-r--r--src/gallium/drivers/virgl/virgl_texture.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/gallium/drivers/virgl/virgl_texture.c b/src/gallium/drivers/virgl/virgl_texture.c
index 4d938ca1e0d..a17c0941282 100644
--- a/src/gallium/drivers/virgl/virgl_texture.c
+++ b/src/gallium/drivers/virgl/virgl_texture.c
@@ -174,19 +174,15 @@ static void virgl_texture_transfer_unmap(struct pipe_context *ctx,
struct virgl_transfer *trans = virgl_transfer(transfer);
struct virgl_resource *vtex = virgl_resource(transfer->resource);
- if (trans->base.usage & PIPE_TRANSFER_WRITE) {
- if (!(transfer->usage & PIPE_TRANSFER_FLUSH_EXPLICIT)) {
- struct virgl_screen *vs = virgl_screen(ctx->screen);
-
- if (trans->resolve_tmp) {
- vs->vws->transfer_put(vs->vws, vtex->hw_res,
- &transfer->box, trans->base.stride,
- trans->l_stride, trans->offset,
- transfer->level);
- } else {
- virgl_transfer_queue_unmap(&vctx->queue, trans);
- }
- }
+ if (transfer->usage & PIPE_TRANSFER_WRITE &&
+ (transfer->usage & PIPE_TRANSFER_FLUSH_EXPLICIT) == 0) {
+ if (trans->resolve_tmp) {
+ struct virgl_winsys *vws = virgl_screen(ctx->screen)->vws;
+ vws->transfer_put(vws, vtex->hw_res, &transfer->box,
+ trans->base.stride, trans->l_stride,
+ trans->offset, transfer->level);
+ } else
+ virgl_transfer_queue_unmap(&vctx->queue, trans);
}
if (trans->resolve_tmp) {