summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl/virgl_resource.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_resource.c')
-rw-r--r--src/gallium/drivers/virgl/virgl_resource.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/virgl/virgl_resource.c b/src/gallium/drivers/virgl/virgl_resource.c
index 441b0c11703..db5e7dd61af 100644
--- a/src/gallium/drivers/virgl/virgl_resource.c
+++ b/src/gallium/drivers/virgl/virgl_resource.c
@@ -89,6 +89,11 @@ static void virgl_buffer_subdata(struct pipe_context *pipe,
{
struct pipe_box box;
+ if (offset == 0 && size == resource->width0)
+ usage |= PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE;
+ else
+ usage |= PIPE_TRANSFER_DISCARD_RANGE;
+
u_box_1d(offset, size, &box);
virgl_transfer_inline_write(pipe, resource, 0, usage, &box, data, 0, 0);
}