virgl: resources without any binding can be cached
authorStéphane Marchesin <marcheu@chromium.org>
Wed, 14 Apr 2021 06:05:24 +0000 (08:05 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 19 Apr 2021 14:59:04 +0000 (14:59 +0000)
commitb460d4da60718a937796a0ad96bd539b8ba77e84
tree146f3e5c8bf58221dedb468856fe208153860104
parent788698383528c3fa3265da476b9dc255353f8bc2
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>
src/gallium/winsys/virgl/drm/virgl_drm_winsys.c