ANV: Waiting for fence from vkAcquireNextImageKHR completely stalls GPU
In WSI, there is currently a sequence of calls which completely stalls the GPU for some reason. Reproduced with Wayland WSI on UHD 620 on Mesa master.
- vkAcquireNextImageKHR() with a fence rather than semaphore
- vkWaitForFences on the WSI fence
The fence however, is not immediately signalled, despite the image being available right away. In older Mesa versions, AcquireNextImageKHR would block and immediately signal the fence on CPU, meaning the fence was basically a noop.
Now however, the fence is not signaled until all work on the GPU has drained, even work unrelated to the acquired swapchain image, meaning there is no CPU <-> GPU overlap at all.
Currently, this cripples any frame overlap in RetroArch which makes use of WSI acquire fences rather than semaphores.
This did not use to happen before, I believe 778b51f4 has something to do with it.