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
(Needs Testing) Improve V-Sync and frame-rate synchronization #234
(Needs Testing) Improve V-Sync and frame-rate synchronization #234
Conversation
Amazing! For me (w7 x64 nvidia) the vsync option is working for the first time with this. |
@porcino What is the refresh rate of your display? Because I was just reviewing the code and I realized that in displays with an refresh rate that are not multiple of 30, I actually am disabling the vsync in the logic, but leaving the option enabled in the menu. (will push a fix for that soon) |
60hz |
Nice, so it should be working properly
Even with this PR? Or are you talking about the current master/nightly? |
Yes with this PR, in windowed mode, with basic windows theme and vsync enabled in game |
Hun... I will setup a Windows VM to test this. Just a question though, are you changing the windows theme while the game is open? If so, could you test starting the game after enabling the basic windows theme to check if the issue persists. |
Same result 31-35 fps with vsync on, stable 30fps without vsync. Since you can't enable vsync in windows mode, why not just ignore the setting? |
Seems like something isn't working properly, will need to debug this on a Windows machine
You should be able to use vsync whether in fullscreen or windowed mode. The only requirement is that the display refresh rate must be a multiple of 30 |
Not really, only Desktop Window Manager can disable or enable vsync in a game in windows mode, you can't have half of the screen synchronized. Is like that for every game |
I think I am misunderstanding something. When using windows basic theme, that results in the WM disabling vsync? If that is so, you are rigth. In windowed mode there is no way for the program to enable vsync afaik, it needs exclusive mode for this. What I meant was that vsync should work in windowed mode, if it's enabled in the WM, so there should be no need for the code to handle synchronization by itself... But I really did forgot to add some check for windowed mode with vsync off, that should default to the synchronization logic... |
Exactly, just like when you change the windows manager in linux to another without gpu acceleration example |
Just pull in the glx and d3d backends instead from https://github.com/Emill/n64-fast3d-engine, which already fixes all these issues. Except for >120 Hz monitors on d3d which I'm working on. SDL's API is not rich enough to correctly deal with vsync timing and deterministic latency. |
Hello,
This is a proposed fix for #168 and some improvements for v-sync detection in setups with multiple monitors of heterogeneous refresh-rate.
The changes included are: