glfw: Vsync doesn't work on macOS 10.14 (Mojave)
I checked example boing (built as boing.app) and it didn’t sync with display refresh rate even with glfwSwapInterval(1) and glfwSwapBuffer. I’m not sure whether it worked on 10.13, but I think so.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 15
- Comments: 24 (6 by maintainers)
Links to this issue
Commits related to this issue
- Fix vsync on OSX 10.14+. This follows the changeset from SDL and GLFW: https://hg.libsdl.org/SDL/rev/73f3ca85ac0e https://github.com/glfw/glfw/issues/1337 But with a few modifications based on my o... — committed to SiegeLord/allegro5 by SiegeLordEx 5 years ago
- Fix vsync on OSX 10.14+. This follows the changeset from SDL and GLFW: https://hg.libsdl.org/SDL/rev/73f3ca85ac0e https://github.com/glfw/glfw/issues/1337 But with a few modifications based on my o... — committed to liballeg/allegro5 by SiegeLordEx 5 years ago
- NSGL: Update current display for display link This solution of one display link per window is far from ideal but is still better than no solution. As a side-effect this fixes swap interval breaking ... — committed to glfw/glfw by elmindreda 5 years ago
- NSGL: Update current display for display link This solution of one display link per window is far from ideal but is still better than no solution. As a side-effect this fixes swap interval breaking ... — committed to m4ce-w1ndu/glfw by elmindreda 5 years ago
Heads up, I just got a solution into SDL for this problem, if you want to adapt it for GLFW:
https://hg.libsdl.org/SDL/rev/73f3ca85ac0e
@Bilalmirza It will be included in 3.3, which should happen in the next couple of weeks.
I don’t know much about macOS, but in Windows you can enforce vsync on/off, so that the GLFW setting won’t do anything.macOS 10.14.4 has been released today, and I can confirm that vsync has started working with GLFW v3.2.1, as @rcgordon suggested in https://github.com/glfw/glfw/issues/1337#issuecomment-474954781.
I can confirm this is a regression due to 10.14. On the previous version of OSX, vsync used to work.
Good news, I adapted @rcgordon’s fix for GLFW
See pull request #1417
@kivutar I think so too, although I’ve only tried GLFW 3.3.4, not 3.3.5. Since this issue was about Mojave specifically and has been fixed, could you please file a new issue to track the new problem with Monterey? Thanks.
Is everyone fine with shipping 3.3 with CVDisplayLink and re-evaluating this for a patch release?
Thanks, @elmindreda, I’ll take a look!
Also: I haven’t confirmed personally, but someone on Twitter told me that the broken vsync support is fixed in the 10.14.2 beta releases, against expectations. If this is true, we’ll all have to decide if we want the CVDisplayLink code at all, as it adds a little complexity to the codebase and is only necessary for people on 10.14.0 and .1, all of whom will be able to do a free update to .2.
Yes, sorry, I had the wrong number; it’s whatever the current beta is.
Can confirm. This is new on mojave and does only happen when using my dedicated GPU, not the integrated one.