summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl/virgl_texture.c
diff options
context:
space:
mode:
authorGurchetan Singh <[email protected]>2019-01-03 10:31:06 -0800
committerGert Wollny <[email protected]>2019-02-15 11:19:05 +0100
commitf0e71b1088848e4190d6f8a5415571d0ddf130aa (patch)
tree05eaeb154c8acb8acdc79fbdba29cd9815e5663e /src/gallium/drivers/virgl/virgl_texture.c
parent4a7857b377d2083f94c28fcdb85abdb8f9d12fde (diff)
virgl: use transfer queue
This improves Unigine Valley benchmark by 3 to 10 fps (depending on the scene). It also improves the Team Fortress 2 benchmark from 6 fps to 13 fps (host: 20 fps). Reviewed-by: Gert Wollny <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_texture.c')
-rw-r--r--src/gallium/drivers/virgl/virgl_texture.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/gallium/drivers/virgl/virgl_texture.c b/src/gallium/drivers/virgl/virgl_texture.c
index 3bffee9b7a5..c661ca91752 100644
--- a/src/gallium/drivers/virgl/virgl_texture.c
+++ b/src/gallium/drivers/virgl/virgl_texture.c
@@ -166,18 +166,22 @@ static void virgl_texture_transfer_unmap(struct pipe_context *ctx,
if (!(transfer->usage & PIPE_TRANSFER_FLUSH_EXPLICIT)) {
struct virgl_screen *vs = virgl_screen(ctx->screen);
vctx->num_transfers++;
- vs->vws->transfer_put(vs->vws, vtex->hw_res,
- &transfer->box, trans->base.stride,
- trans->l_stride, trans->offset,
- transfer->level);
+ 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 (trans->resolve_tmp)
+ if (trans->resolve_tmp) {
pipe_resource_reference((struct pipe_resource **)&trans->resolve_tmp, NULL);
-
- virgl_resource_destroy_transfer(&vctx->transfer_pool, trans);
+ virgl_resource_destroy_transfer(&vctx->transfer_pool, trans);
+ }
}
static const struct u_resource_vtbl virgl_texture_vtbl =