virgl: honor DISCARD_WHOLE_RESOURCE in virgl_res_needs_readback
authorChia-I Wu <olvaffe@gmail.com>
Tue, 14 May 2019 17:14:03 +0000 (10:14 -0700)
committerChia-I Wu <olvaffe@gmail.com>
Wed, 15 May 2019 20:51:28 +0000 (20:51 +0000)
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
src/gallium/drivers/virgl/virgl_resource.c

index 52197b8017532b395c22fdbe4cf2c44690d84efb..5d1ee234ea28d55b2f4aebabeeeb1552ef05cfbd 100644 (file)
@@ -93,7 +93,8 @@ bool virgl_res_needs_readback(struct virgl_context *vctx,
                               struct virgl_resource *res,
                               unsigned usage, unsigned level)
 {
-   if (usage & PIPE_TRANSFER_DISCARD_RANGE)
+   if (usage & (PIPE_TRANSFER_DISCARD_RANGE |
+                PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE))
       return false;
 
    if (res->clean_mask & (1 << level))