Vulkan: return to more conventional swapchain sync method, encapsulate more code #525
Loading…
Reference in a new issue
No description provided.
Delete branch "fixchainimagecount"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
#502 adopted a swapchain sync method that is correct in theory but is not commonly used.
This changes the sync method back to what was used before.
The validation layer appears to not have made up their mind about whether using only a fence is valid and one of the authors of the vulkan specification says it is unintended and basically advises against it here
This PR also ups the minimum swapchain image count to at least two images (not min+1 which might be > 2 causing unnecessary input lag and wasting resources). Using only one swapchain image caused a freeze on AMD windows drivers when switching to fullscreen.
One of the issues that popped up after removing the acquire semaphore is that on macOS the fonts in the imgui overlay disappeared.
I do not have a concrete answer as to why moltenVK has issues while other platforms do not. It may be that moltenVK assumes swapchain image access is guarded with a semaphore.
Additionally some more swapchain code is moved from VulkanRenderer into the SwapchainInfoVk class. There is likely more code that could be moved there before the encapsulation is optimal but that would make the scope of the PR a bit too large.
Since you already introduced
SwapchainInfoVk
you should use methods and not exposem_imageAvailableFence
to VulkanRenderer directly.I'd also prefer if we could avoid the usage of a timeout for
vkWaitForFences
inRecreateSwapchain()
. Whether the fence is going to be signaled or not should always be a well defined state?I think this moves the encapsulation of the swapchain in the right direction. I think it could go further but that would require more effort