From ab97f78fa5e46ef1d93b1a7aa4d6e6c87d6ad6bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 13 Jan 2020 09:27:06 +0100 Subject: [PATCH] Revert "Enable Vsync via Compositor by default" This reverts commit 9600fd5dde1f85b7dd2dd8558d52ff86b18651e7. Add comment warning about possible implications of using this option. Fixes #35038. --- core/bind/core_bind.cpp | 2 +- doc/classes/OS.xml | 3 ++- doc/classes/ProjectSettings.xml | 3 ++- main/main.cpp | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 4586dc6d1416..0eacffeb8840 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -1393,7 +1393,7 @@ void _OS::_bind_methods() { ADD_PROPERTY_DEFAULT("current_screen", 0); ADD_PROPERTY_DEFAULT("exit_code", 0); ADD_PROPERTY_DEFAULT("vsync_enabled", true); - ADD_PROPERTY_DEFAULT("vsync_via_compositor", true); + ADD_PROPERTY_DEFAULT("vsync_via_compositor", false); ADD_PROPERTY_DEFAULT("low_processor_usage_mode", false); ADD_PROPERTY_DEFAULT("low_processor_usage_mode_sleep_usec", 6900); ADD_PROPERTY_DEFAULT("keep_screen_on", true); diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 2236c4209494..2c44a3dfb09e 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -937,8 +937,9 @@ If [code]true[/code], vertical synchronization (Vsync) is enabled. - + If [code]true[/code] and [code]vsync_enabled[/code] is true, the operating system's window compositor will be used for vsync when the compositor is enabled and the game is in windowed mode. + [b]Note:[/b] This option is experimental and meant to alleviate stutter experienced by some users. However, some users have experienced a Vsync framerate halving (e.g. from 60 FPS to 30 FPS) when using it. [b]Note:[/b] This property is only implemented on Windows. diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 1e714d92c2c6..221214409f64 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -440,8 +440,9 @@ If [code]true[/code], enables vertical synchronization. This eliminates tearing that may appear in moving scenes, at the cost of higher input latency and stuttering at lower framerates. If [code]false[/code], vertical synchronization will be disabled, however, many platforms will enforce it regardless (such as mobile platforms and HTML5). - + If [code]Use Vsync[/code] is enabled and this setting is [code]true[/code], enables vertical synchronization via the operating system's window compositor when in windowed mode and the compositor is enabled. This will prevent stutter in certain situations. (Windows only.) + [b]Note:[/b] This option is experimental and meant to alleviate stutter experienced by some users. However, some users have experienced a Vsync framerate halving (e.g. from 60 FPS to 30 FPS) when using it. diff --git a/main/main.cpp b/main/main.cpp index 5cfab3dc4af2..7015902e1995 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1035,7 +1035,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph // window compositor ("--enable-vsync-via-compositor" or // "--disable-vsync-via-compositor") was present then it overrides the // project setting. - video_mode.vsync_via_compositor = GLOBAL_DEF("display/window/vsync/vsync_via_compositor", true); + video_mode.vsync_via_compositor = GLOBAL_DEF("display/window/vsync/vsync_via_compositor", false); } OS::get_singleton()->_vsync_via_compositor = video_mode.vsync_via_compositor;