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

Set vsync on window creation when using GLES3 #68700

Merged
merged 1 commit into from
Nov 15, 2022

Conversation

clayjohn
Copy link
Member

This is necessary so that the vsync settings actually take effect when the scene is loaded. This is what we did in 3.x as well. We just missed this as OpenGL wasn't available when we overhauled vsync for 4.0.

Also adds vsync to Windows platform.

Tested on Windows and Linux

Add vsync to Windows platform
@akien-mga akien-mga merged commit 5993209 into godotengine:master Nov 15, 2022
@akien-mga
Copy link
Member

Thanks!

@clayjohn clayjohn deleted the GLES3-vsync branch November 15, 2022 23:40
@Lateasusual
Copy link
Contributor

This causes a segmentation fault on startup for me on linux, nvidia drivers (520.56.06)

Thread 1 "godot.linuxbsd." received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x0000555555ff7e2f in GLManager_X11::set_use_vsync(bool) ()
#2  0x0000555555fd6b14 in DisplayServerX11::window_set_vsync_mode(DisplayServer::VSyncMode, int) ()
#3  0x0000555555fe395a in DisplayServerX11::_create_window(DisplayServer::WindowMode, DisplayServer::VSyncMode, unsigned int, Rect2i const&) ()
#4  0x0000555555fec3cc in DisplayServerX11::DisplayServerX11(String const&, DisplayServer::WindowMode, DisplayServer::VSyncMode, unsigned int, Vector2i const*, Vector2i const&, Error&) ()
#5  0x0000555555fed3ff in DisplayServerX11::create_func(String const&, DisplayServer::WindowMode, DisplayServer::VSyncMode, unsigned int, Vector2i const*, Vector2i const&, Error&) ()
#6  0x000055555600e604 in Main::setup2(unsigned long) ()
#7  0x00005555560170f3 in Main::setup(char const*, int, char**, bool) ()
#8  0x0000555555fba40b in main ()

@clayjohn
Copy link
Member Author

@Lateasusual Can you please test out #68714 and see if that fixes the issue for you? I am not able to reproduce the crash, but I noticed some suspicious code (or lack thereof) when comparing the vsync code with the 3.x equivalent.

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

Successfully merging this pull request may close these issues.

3 participants