dxgi: Fix some d3d12 swapchain issues.
The last commit fixes glitches in Horizon Zero Dawn with vsync on, for reasons stated in the comment there.
The wined3d implementation already blocks the client's call to Present()
when vkAcquireNextImageKHR()
blocks, so is roughly equivalent to this when frame latency and buffer count are equal. It has a frame latency implementation which unblocks after calling vkQueuePresentKHR()
, rather than waiting for its execution to complete. I think the d3d12 implementation is supposed to do the latter, though using KHR_present_wait
may be unnecessary overkill. Waiting on queue execution comes with a performance cost either way, so without a compelling reason for a strict implementation, something similar to wined3d makes sense.
Another potential issue is after the call to ID3D12CommandQueue_Signal()
in d3d12_swapchain_present()
, the client is free to enqueue more commands when Present()
returns, so by the time the signal is executed and the swapchain worker blits the image and calls vkQueuePresentKHR()
, these commands are not necessarily enqueued immediately after the Signal()
. This may not always be harmless.