-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
On/off VSync support for vulkan #36862
Conversation
65ec8f4
to
9a831a5
Compare
Being a boolean setting, the code will choose the best available present mode to fit user's choice. Presentation modes are ordered from no tearing to non-sync modes (will probably have tearing).
9a831a5
to
92e2753
Compare
Any chance we can implement this so i can test it, |
@giarve Out of curiosity, how difficult would it be to adapt this PR to expose adaptive V-Sync? (In other words, V-Sync that automatically disables itself when the FPS is below the monitor refresh rate to avoid stuttering at low FPS.) |
According to the specification:
Looks like what you're asking for. If you have a project in which you're able to reproduce stuttering issues, recompile the engine changing:
to
in and rerun the game and check if it solves the stuttering. Depending on the GPU you may not have this presentation mode available, in that case I won't be of much help. In fact, this PR was first created to address compatibility issues with different presentation modes, because this change set what only does is selecting the most differentiating mode available for VSync enabled or disabled. The main problem of this PR is that it doesn't allow you to select which exact mode you want to try, so it could be interesting (if you find the VK_PRESENT_MODE_FIFO_RELAXED_KHR to work) to expose the available presentation mode list to settings, or just exposing what you suggested, toggling adaptive V-Sync. I wouldn't be able to make a custom adaptive Vsync because it looks like a more advanced topic. When I last checked the code the default mode was full VSync enabled, with three buffers but without the MAILBOX presentation mode enabled (which would be required to enable triple buffering and minimize latency). By default, the VK_PRESENT_MODE_FIFO_KHR is the one enabled, which is good for mobile because it has the least battery consumption. Take into account that this PR is Vulkan only and wouldn't solve the problems with Godot stable may have (if there are any, which I don't know). |
I would like to see this merged soon since disabling VSync helps with profiling. |
Needs to be rebased |
I am currently trying to reimplement this with a newer version of Godot since I failed to rebase giarve's branch(too many changes since then).
|
Closing per discussion on IRC, as this PR needs to be redone following recent DisplayServer changes:
|
Being a boolean setting, the code will choose the best available present mode to fit user's choice.
Presentation modes are ordered from no tearing to non-sync modes (will probably have tearing).
Fixes #36467.