summaryrefslogtreecommitdiff
path: root/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
diff options
context:
space:
mode:
authorStéphane Marchesin <marcheu@chromium.org>2021-04-14 08:05:24 +0200
committerMarge Bot <eric+marge@anholt.net>2021-04-19 14:59:04 +0000
commitb460d4da60718a937796a0ad96bd539b8ba77e84 (patch)
tree146f3e5c8bf58221dedb468856fe208153860104 /src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
parent788698383528c3fa3265da476b9dc255353f8bc2 (diff)
virgl: resources without any binding can be cached
Certain games create and destroy lots of resources without binding them. This can take quite a bit of time and even create unneeded synchronization. However, we know that if a resource was never bound to anything, it can be cached. This change does that. Counting the number of uncached allocation with a tabletop simulator trace: Before: 2967 uncached allocations over the replay After: 24 uncached allocations over the replay Reviewed-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10225>
Diffstat (limited to 'src/gallium/winsys/virgl/drm/virgl_drm_winsys.c')
-rw-r--r--src/gallium/winsys/virgl/drm/virgl_drm_winsys.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
index 76e122536b2..6ff94ced519 100644
--- a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
+++ b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
@@ -63,7 +63,8 @@ static inline boolean can_cache_resource(uint32_t bind)
bind == VIRGL_BIND_VERTEX_BUFFER ||
bind == VIRGL_BIND_CUSTOM ||
bind == VIRGL_BIND_STAGING ||
- bind == VIRGL_BIND_DEPTH_STENCIL;
+ bind == VIRGL_BIND_DEPTH_STENCIL ||
+ bind == 0;
}
static void virgl_hw_res_destroy(struct virgl_drm_winsys *qdws,