Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Vulkan] Add relaxed FIFO presentation mode #2828

Conversation

bobcao3
Copy link
Collaborator

@bobcao3 bobcao3 commented Aug 28, 2021

https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPresentModeKHR.html

VK_PRESENT_MODE_FIFO_RELAXED_KHR specifies that the presentation engine generally waits for the next vertical blanking period to update the current image. If a vertical blanking period has already passed since the last update of the current image then the presentation engine does not wait for another vertical blanking period for the update, meaning this mode may result in visible tearing in this case. This mode is useful for reducing visual stutter with an application that will mostly present a new image before the next vertical blanking period, but may occasionally be late, and present a new image just after the next vertical blanking period. An internal queue is used to hold pending presentation requests. New requests are appended to the end of the queue, and one request is removed from the beginning of the queue and processed during or after each vertical blanking period in which the queue is non-empty.

When this is detected and vsync is requested, relaxed FIFO will be preferred as it reduces latency & "choppyness" when a frame is a little too long to hit the correct V-Blank timing, by allowing a tearing to appear in such scenerio (e.g. 59FPS & almost hitting 60)

@bobcao3 bobcao3 requested a review from AmesingFlank August 28, 2021 08:31
@bobcao3 bobcao3 changed the title [Vulkan] Add related FIFO & use it when possible [Vulkan] Add relaxed FIFO & use it when possible Aug 28, 2021
@bobcao3 bobcao3 changed the title [Vulkan] Add relaxed FIFO & use it when possible [Vulkan] Add relaxed FIFO presentation mode Aug 28, 2021
@bobcao3
Copy link
Collaborator Author

bobcao3 commented Aug 28, 2021

/format

@AmesingFlank AmesingFlank merged commit 02e923b into taichi-dev:master Aug 28, 2021
@g1n0st g1n0st added the vulkan Vulkan backend label Aug 28, 2021
@Leonz5288 Leonz5288 mentioned this pull request Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vulkan Vulkan backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants