NVidia Vulkan drivers have had a long standing technical debt where presentKHR blocks until the image is presented, which can be for a very long time in FIFO mode.
Even if that is a valid implementation, that’s a though pill to swallow since the spec doesn’t even allow a timeout parameter for that call.
The VK_KHR_present_wait extension is supposed to provide a vkWaitForPresentKHR function which can be used to wait for presentation.
The NVidia Windows Vulkan drivers claim to implement that extension, but according to my tests, the blocking behavior on presentKHR is still there, which makes the utility of this extension a bit dubious.
Is this behavior as intended, or is that a problem on my end?
I attach the demo which I used for my tests, which is just vkcube.cpp extended to support the extension.
First patch is the main implementation, second patch adds printing of some metrics, and I also attach the full source code for convenience.
The diff is against the demo in SDK version 18.104.22.168.
FWIW the same demo works as expected when tested on a WINE Linux setup with Intel graphics.
On NVidia windows it prints metrics which suggest all waiting is happening on presentKHR:
On Linux Wine intel it prints metrics which suggest no blocking on presentKHR, all the waiting is happening on waitForPresent:
The affected setup is Windows 11 machine with a RTX 3060 connected to a PHL 499P9 monitor.