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

Vsync doesn't work on macOS 10.14 (Mojave) #1337

Open
hajimehoshi opened this Issue Sep 29, 2018 · 12 comments

Comments

Projects
None yet
@hajimehoshi
Copy link

hajimehoshi commented Sep 29, 2018

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.

@ghuser404

This comment has been minimized.

Copy link

ghuser404 commented Sep 29, 2018

It may depend on whether your GPU driver is forcing this.

@hajimehoshi

This comment has been minimized.

Copy link

hajimehoshi commented Sep 29, 2018

Hi, I'm using MacBook Pro 2018, and I think vsync is enforced.

@hajimehoshi

This comment has been minimized.

Copy link

hajimehoshi commented Sep 29, 2018

My graphics card info

Intel Iris Plus Graphics 655:

  Chipset Model:	Intel Iris Plus Graphics 655
  Type:	GPU
  Bus:	Built-In
  VRAM (Dynamic, Max):	1536 MB
  Vendor:	Intel
  Device ID:	0x3ea5
  Revision ID:	0x0001
  Metal:	Supported, feature set macOS GPUFamily2 v1
  Displays:
Color LCD:
  Display Type:	Built-In Retina LCD
  Resolution:	2560 x 1600 Retina
  Framebuffer Depth:	24-Bit Color (ARGB8888)
  Main Display:	Yes
  Mirror:	Off
  Online:	Yes
  Rotation:	Supported
  Automatically Adjust Brightness:	No
@ghuser404

This comment has been minimized.

Copy link

ghuser404 commented Sep 29, 2018

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.

@kivutar

This comment has been minimized.

Copy link

kivutar commented Oct 7, 2018

I can confirm this is a regression due to 10.14. On the previous version of OSX, vsync used to work.

@mokafolio

This comment has been minimized.

Copy link

mokafolio commented Oct 17, 2018

Can confirm. This is new on mojave and does only happen when using my dedicated GPU, not the integrated one.

@dmitshur

This comment has been minimized.

Copy link
Collaborator

dmitshur commented Oct 19, 2018

I can also confirm this, it's a regression in macOS 10.14 and wasn't a problem in 10.13.

This issue may be related to #1334 in some way. What I'm observing is that vsync works until you move or resize the window (to work around #1334), and then it stops working. E.g., see the following terminal output:

<--- started an OpenGL application with glfwSwapInterval(1)
fps: 56
fps: 60
fps: 60
fps: 60
fps: 60
fps: 60
fps: 60
fps: 60
fps: 60
fps: 60
<--- I moved the window at this point; it stopped being black and started to display content.
fps: 85
fps: 221
fps: 222
fps: 221
fps: 221
fps: 220
fps: 220
fps: 221
fps: 220
fps: 220
fps: 221
fps: 220
fps: 221
@gimblll

This comment has been minimized.

Copy link

gimblll commented Dec 7, 2018

Still broken with the 10.14.2 update. Anyone have any workarounds?

@gimblll

This comment has been minimized.

Copy link

gimblll commented Dec 13, 2018

Answering myself: the workaround I got working now was compiling with XCode 9 instead of 10. Seems SDL has come to the same conclusion https://discourse.libsdl.org/t/sdl2-no-renderer-vsync-on-macos-mojave/25169/21

@rcgordon

This comment has been minimized.

Copy link

rcgordon commented Dec 16, 2018

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

@gerryhernandez

This comment has been minimized.

Copy link

gerryhernandez commented Dec 16, 2018

Great work, and you saved my bacon. Thank you!

@amarcu5

This comment has been minimized.

Copy link

amarcu5 commented Jan 14, 2019

Good news, I adapted @rcgordon's fix for GLFW

See pull request #1417

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment