anv: Use submit-time implicit sync instead of allocate-time

Graphics / Mesa 3D Graphics Library / Mesa - Jason Ekstrand [jlekstrand.net] - 6 December 2019 19:58 UTC

In 83b943cc2f24, we started making all VkDeviceMemory BOs resident all the time. One unfortunate side-effect of this is that every
vkQueueSubmit sets EXEC_OBJECT_WRITE on every WSI memory object which means that X server or Wayland compositor, instead of waiting on the last vkQueueSubmit to actually write the buffer, now waits on the last
vkQueueSubmit to from that driver instance relative to whenever the compositor's GL driver instance calls execbuf. This potentially leads to a lot of extra synchronization that we didn't intend to have.

Instead, this commit makes it so that we leave WSI memory objects with EXEC_OBJECT_ASYNC most of the time and only unset EXEC_OBJECT_ASYNC and set EXEC_OBJECT_WRITE in the dummy execbuf that we do as part of
vkQueuePresent. This should hopefully result in tighter integration with the compositor, lower latency, and better performance.

Testing with DOOM 2016, this seems to reduce latency by at least a frame if not two and makes the game much more responsive. Testing was, however, subjective, so we don't have any hard data on that.

ccb7d606f1a anv: Use submit-time implicit sync instead of allocate-time
src/intel/vulkan/anv_device.c | 13 -------------
src/intel/vulkan/anv_queue.c | 20 ++++++++++++++++++--
2 files changed, 18 insertions(+), 15 deletions(-)

Upstream: cgit.freedesktop.org


  • Share