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

Black screen and VSync problems on MacOS Mojave #231

Closed
mokiat opened this issue Nov 7, 2018 · 10 comments
Closed

Black screen and VSync problems on MacOS Mojave #231

mokiat opened this issue Nov 7, 2018 · 10 comments
Labels

Comments

@mokiat
Copy link

mokiat commented Nov 7, 2018

Hi,

I have been playing with go-gl/gl and go-gl/glfw for some time now in my rally-mka project.

Everything worked perfect up until I updated to MacOS Mojave. When I start the application, the screen is initially black. If I resize the window, the game starts to render to screen normally for around a second or two after which it goes black again.

Furthermore, the game speeds up drastically, as vsync does not seem to work.

(Yes, I am aware that timestamp deltas should be used for scene updates. The game is a port to Go of something I did many years ago, so its design is crap. 😅I just use it to experiment with and learn newer OpenGL versions and see how Go copes).


Issue #228 seems like a duplicate to this, however, I am using the latest version of glfw and the issue is not fixed for me. Furthermore, the vsync issue is not described there.

There is also pull request #219 where @kivutar mentions these problems, though I could not find them in GitHub issue tracker.


Is this related to OpenGL deprecation? My understanding was that it would continue to be supported for some time. Furthermore, the issue seems to be glfw related, and that project seems necessary even if one were to switch to Vulkan.

@Noofbiz
Copy link

Noofbiz commented Nov 7, 2018

It's been fixed on glfw 3.3 but I'm not sure if it's going to be fixed in the previous releases. I have a fix you can put just before you swap buffers here https://github.com/Noofbiz/glfwMojaveFix that you can use. It just calls the context update on OSX and nothing otherwise.

@Noofbiz
Copy link

Noofbiz commented Nov 7, 2018

Oh that's only for the blank screen, not sure about the vsync issue unfortunately

@dmitshur
Copy link
Member

dmitshur commented Nov 8, 2018

Is this related to OpenGL deprecation? My understanding was that it would continue to be supported for some time.

OpenGL is deprecated in the latest macOS, but it's still supported. This is just something that needs to be fixed in GLFW upstream, and made available as a Go package.

The black-screen-until-window-move issue has been resolved upstream in glfw/glfw#1334.

The vsync issue is not yet resolved upstream, see glfw/glfw#1337.

My recommendation would be to help the upstream GLFW project resolve the issue there, and then we can consider either backporting the fix to our 3.2 Go package, wait for GLFW to backport the fix to 3.2 and update our 3.2 version, or just wait until 3.3 is out with the fixes.

@mokiat
Copy link
Author

mokiat commented Nov 8, 2018

@Noofbiz thanks for the fix! I will have a look at it.

@dmitshur now it all makes sense. Thanks! I don't know why I presumed that the problem is in the go binding. Looking forward to 3.3.

@mokiat
Copy link
Author

mokiat commented Nov 15, 2018

@Noofbiz I tried your fix (though I adapted it for 3.2). It does fix the black screen problem, however, as you already mentioned, the vsync issue is still there.

Something else that I am observing is that performance seems to be worse than before. I used to be able to run the app in fullscreen without a problem and now it lags. Could be related to the vsync problem.

Damn, it seems that Apple, Metal, and Vulkan have messed everything up. The only place I can develop 3D properly now is in a Linux Virtual Machine, where it lags to begin with...

@kivutar
Copy link

kivutar commented Jan 30, 2019

There was an OSX update that fixed the black screen two weeks ago, but not the vsync issue.

@mokiat
Copy link
Author

mokiat commented Jan 31, 2019

Yes, I am using time.Sleep to keep it at 60fps but it's not an actual vsync.

@elmindreda
Copy link

OpenGL swap interval should work on Mojave now.

@dmitshur
Copy link
Member

macOS 10.14.4 has been released today, and vsync has started working once again with the current latest version of go-gl/glfw/v3.2. This was anticipated based on glfw/glfw#1337 (comment).

@mokiat
Copy link
Author

mokiat commented Mar 31, 2019

Yes, I can confirm that both black screen and vsync issues have been resolved. Thanks! Closing this issue.

@mokiat mokiat closed this as completed Mar 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants