-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 fails to work while SDL window is covered by another opaque window in Mac OS X #1871
Comments
I am able to reproduce this issue on macOS 11.2.3. Running the test application gives:
It looks like CVDisplayLink support was introduced in 13869f1 and later backed out in 04b50f6 due to #3218. I am currently working around this with an Are the issues when using CVDisplayLink inherent or can it be fixed? I couldn't quite get all the context from #3218. @icculus |
Looks like GLFW has seen both this issue and the "broken vsync on a specific mojave patch" issue and resolved them using CVDisplayLink. glfw/glfw#680 They then also removed CVDisplayLink glfw/glfw@54e8e0b and instead committed a workaround glfw/glfw@c3ca880 which |
It caused problems with multi-monitor setups and just is an enormous amount of code that felt very fragile when it usually just needs a single Cocoa call to say "the OS should handle this for us." |
…s not visible (#7611) Fixes #5856. Fixes #8080. Fixes #9040. # Objective We need to limit the update rate of games whose windows are not visible (minimized or completely occluded). Compositors typically ignore the VSync settings of windows that aren't visible. That, combined with the lack of rendering work, results in a scenario where an app becomes completely CPU-bound and starts updating without limit. There are currently three update modes. - `Continuous` updates an app as often as possible. - `Reactive` updates when new window or device events have appeared, a timer expires, or a redraw is requested. - `ReactiveLowPower` is the same as `Reactive` except it ignores device events (e.g. general mouse movement). The problem is that the default "game" settings are set to `Contiuous` even when no windows are visible. ### More Context - libsdl-org/SDL#1871 - glfw/glfw#680 - godotengine/godot#19741 - godotengine/godot#64708 ## Solution Change the default "unfocused" `UpdateMode` for games to `ReactiveLowPower` just like desktop apps. This way, even when the window is occluded, the app still updates at a sensible rate or if something about the window changes. I chose 20Hz arbitrarily.
…s not visible (#7611) Fixes #5856. Fixes #8080. Fixes #9040. # Objective We need to limit the update rate of games whose windows are not visible (minimized or completely occluded). Compositors typically ignore the VSync settings of windows that aren't visible. That, combined with the lack of rendering work, results in a scenario where an app becomes completely CPU-bound and starts updating without limit. There are currently three update modes. - `Continuous` updates an app as often as possible. - `Reactive` updates when new window or device events have appeared, a timer expires, or a redraw is requested. - `ReactiveLowPower` is the same as `Reactive` except it ignores device events (e.g. general mouse movement). The problem is that the default "game" settings are set to `Contiuous` even when no windows are visible. ### More Context - libsdl-org/SDL#1871 - glfw/glfw#680 - godotengine/godot#19741 - godotengine/godot#64708 ## Solution Change the default "unfocused" `UpdateMode` for games to `ReactiveLowPower` just like desktop apps. This way, even when the window is occluded, the app still updates at a sensible rate or if something about the window changes. I chose 20Hz arbitrarily.
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Reported in version: HG 2.0
Reported for operating system, platform: Mac OS X (All), x86_64
Comments on the original bug report:
On 2015-06-02 10:16:59 +0000, Joshua Bodine wrote:
On 2015-06-02 17:27:18 +0000, Alex Szpakowski wrote:
On 2015-10-03 01:59:31 +0000, Alex Szpakowski wrote:
On 2017-07-08 17:16:47 +0000, Joshua Bodine wrote:
On 2017-07-14 02:58:05 +0000, Alex Szpakowski wrote:
On 2017-09-01 05:42:58 +0000, Joshua Bodine wrote:
On 2017-09-01 17:30:03 +0000, Sam Lantinga wrote:
On 2017-09-01 21:20:46 +0000, Alex Szpakowski wrote:
On 2018-08-06 21:20:23 +0000, Ryan C. Gordon wrote:
The text was updated successfully, but these errors were encountered: