Update Swapchain image count to obey present mode constraints#1081
Open
SRSaunders wants to merge 4 commits intoRobertBeckebans:masterfrom
Open
Update Swapchain image count to obey present mode constraints#1081SRSaunders wants to merge 4 commits intoRobertBeckebans:masterfrom
SRSaunders wants to merge 4 commits intoRobertBeckebans:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR separates and updates how semaphores are used for Vulkan image acquisition and presentation sync. This follows best practices documented in https://docs.vulkan.org/guide/latest/swapchain_semaphore_reuse.html.
NUM_FRAME_DATAimage acquisition semaphores to match the number of frames-in-flight for the renderer, and continues to use a circular queue for cycling through image acquisition semaphores.VK_EXT_surface_maintenance1is available in the implementation, requestsminImageCountandmaxImageCountfor the specific presentation mode selected for the swapchain, and uses these to bound the requested swapchain image count during swapchain creation.m_SwapChainIndexreturned fromvkAcquireNextImageKHR()to index into the presentation semaphore vector when synchronizing withinvkPresentKHR(). This is to support potential out-of-order image acquisition which can occur in certain circumstances depending on the presentation engine.This PR also updates a macOS-specific item:
Fixes #1080.
Tested on Windows 11 Vulkan, Manjaro Linux, and macOS Sequoia.