summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl/virgl_resource.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-07-17 14:34:50 +0200
committerMarek Olšák <[email protected]>2016-07-23 13:33:42 +0200
commit8e3e9d283976c30a8ba9b51821bc61ddf782e2b0 (patch)
treee3087f09c219c3afe11a7626022e25d11dfe0a00 /src/gallium/drivers/virgl/virgl_resource.c
parent1ffe77e7bb2486ea74cda077ed2a9622b758395c (diff)
gallium/util: don't modify usage in pipe_buffer_write
All drivers were already doing it except virgl. Reviewed-by: Nicolai Hähnle <[email protected]>
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);
}