-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Linux/OpenGL: Don't force vsync in the editor #82221
Linux/OpenGL: Don't force vsync in the editor #82221
Conversation
I couldn't tell whether this has an actual purpose and it feels more like a debug remnant. We also need to be able to disable vsync in the editor for the WIP Wayland backend (in the EGL driver) as it does manual frame throttling.
What is the purpose of this on X11? When I disable VSync on the editor (xfce + x11) my video card goes into full overdrive (110°C Junction Speed, which is expected but also overkill). It should definitely be on. It is also a feature that can be toggled from the Editor so I don't understand why it should be hard-coded? I can't speak for Wayland; but in principle Wayland also prefers VSync. I wouldn't be surprised though that it breaks VSync On + XWayland as Godot right now lacks a native Wayland backend. (Edit: Re-reading what I wrote it sounds like it's an aggressive or condescending tone; that's not the intention) |
Just consistency tbh.
Yeah that's the thing. I'm not removing VSync (or at least, it shouldn't), I'm removing this weird override that doesn't allow us to do it in the first place.
Actually it might be surprising but we need to disable the "hard" vsync and switch to the equivalent of mailbox on OGL due to the fact that we're main thread bound and we have to throttle all frames manually based on when Wayland tells us that we can draw. Otherwise everything hard locks until the window is visible. I know, this sounds weird but I couldn't find any better solution and it genuinely looks to me like it's supposed to be done. See also: https://emersion.fr/blog/2018/wayland-rendering-loop/
I'm not exactly sure what you're talking about. If you're meaning that vsync might be broken on XWayland IIRC it should work as it uses the GLX driver. Not sure though.
No worries, text is ambiguous so I think that it's been a good idea to clarify :) BTW does this actually disable vsync full stop in the editor? As I said I haven't tested this on anything other than wayland which depends on being able to override itself the vsync mode. |
Oh I completely misread your PR! I saw you were doing the opposite! (I thought you wanted to force-disable VSync) Yeah, VSync should not be forced on; it should follow Editor settings. |
I couldn't tell you whether I added that, or copy pasted in from an earlier section from e.g. 3.x. Either way it was from my very early GLES2 tests that went on to be used to bootstrap GLES3. I think it's fine to remove. If it was me, it is likely the main danger I was trying to avoid at the time for debugging etc (particularly at that early stage of 4.x where there were lots of bugs) was with redraw requests. It is very easy to get into a situation where you are getting a bunch of redraw requests in the editor. At least with vsync on, you are limiting how much processing this can take, but with vsync off you could end up rendering e.g. 1000fps while moving your mouse. But remember this was at a time of basically getting anything on the screen at all was a bonus, and expecting all this code to be gone over with fine toothed comb at a later date. |
I suggest merging #48364 along the way 🙂 If you want low input lag in the editor and don't have a VRR display (or can't use VRR for Godot), disabling V-Sync is the only way to achieve low input lag. However, this is currently tied to the V-Sync project setting or the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to remove this, but what controls whether the editor uses vsync currently?
If it's based on the edited project's settings, then it can indeed be problematic if users disable vsync for their project and that automatically disables it for the editor.
But I guess Calinou's PR decouples that?
Thanks! |
I couldn't tell whether this has an actual purpose and it feels more like a debug remnant.
We also need to be able to disable vsync in the editor for the WIP Wayland backend (in the EGL driver) as it does manual frame throttling.
CC @lawnjelly which seems the original author of this code.
Note that I haven't tested the X11 part and I've tested the EGL change only with the Wayland branch, so some further testing would be a good idea.