summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl/virgl_resource.c
diff options
context:
space:
mode:
authorAlexandros Frantzis <[email protected]>2019-05-08 16:17:53 +0300
committerChia-I Wu <[email protected]>2019-06-07 21:45:36 -0700
commit6e7726e50c44c28969b20dc79e5c6f7a26eb6edd (patch)
tree4e602578724d4065eaa67b641cf22f9bcbaf0360 /src/gallium/drivers/virgl/virgl_resource.c
parent199d95f29ed0177bab77c7d348a88e26cd4d23c0 (diff)
virgl: Support copy transfers
Support transfers that use a different resource as the source of data to transfer. This will be used in upcoming commits to send data to host buffers through a transfer upload buffer, in order to avoid waiting when the buffer resource is busy. Note that we don't support queueing copy transfers in the transfer queue. Copy transfers should be emitted directly in the command queue, allowing us to avoid flushes before them and leads to better performance. Signed-off-by: Alexandros Frantzis <[email protected]> Reviewed-by: Chia-I Wu <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_resource.c')
-rw-r--r--src/gallium/drivers/virgl/virgl_resource.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/drivers/virgl/virgl_resource.c b/src/gallium/drivers/virgl/virgl_resource.c
index e334d55fa79..fd01df1c10a 100644
--- a/src/gallium/drivers/virgl/virgl_resource.c
+++ b/src/gallium/drivers/virgl/virgl_resource.c
@@ -401,6 +401,8 @@ virgl_resource_create_transfer(struct slab_child_pool *pool,
trans->base.layer_stride = metadata->layer_stride[level];
trans->offset = offset;
util_range_init(&trans->range);
+ trans->copy_src_res = NULL;
+ trans->copy_src_offset = 0;
if (trans->base.resource->target != PIPE_TEXTURE_3D &&
trans->base.resource->target != PIPE_TEXTURE_CUBE &&
@@ -417,6 +419,7 @@ virgl_resource_create_transfer(struct slab_child_pool *pool,
void virgl_resource_destroy_transfer(struct slab_child_pool *pool,
struct virgl_transfer *trans)
{
+ pipe_resource_reference(&trans->copy_src_res, NULL);
util_range_destroy(&trans->range);
slab_free(pool, trans);
}