Vulkan: Fix flicker on resize #522
Loading…
Reference in a new issue
No description provided.
Delete branch "fixflicker"
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?
When a swapchain becomes suboptimal after an acquire for rendering, SwapBuffer would recreate the swapchain and acquire a new image from it which would get filled in with black because the content is undefined, resulting in black flickering when resizing.
By changing the order in AcquireNextSwapchainImage it'll always try to present the suboptimal image it already acquired and drew content to and drop the image if it is out of date and cannot be used. Then when no image is reserved anymore the next acquire will recreate the swapchain.
FYI on Windows there is a white flicker when resizing. It's been there pre-2.0 too. Interestingly, this PR doesn't affect it.