Merge pull request #56110 from Calinou/print-fps-vsync-mode-3.x

This commit is contained in:
Rémi Verschelde 2021-12-21 09:28:19 +01:00 committed by GitHub
commit f93f2cd17d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1312,6 +1312,22 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
} }
#endif #endif
if (GLOBAL_GET("debug/settings/stdout/print_fps") || print_fps) {
// Print requested V-Sync mode at startup to diagnose the printed FPS not going above the monitor refresh rate.
if (OS::get_singleton()->_use_vsync && OS::get_singleton()->_vsync_via_compositor) {
#ifdef WINDOWS_ENABLED
// V-Sync via compositor is only supported on Windows.
print_line("Requested V-Sync mode: Enabled (via compositor) - FPS will likely be capped to the monitor refresh rate.");
#else
print_line("Requested V-Sync mode: Enabled - FPS will likely be capped to the monitor refresh rate.");
#endif
} else if (OS::get_singleton()->_use_vsync) {
print_line("Requested V-Sync mode: Enabled - FPS will likely be capped to the monitor refresh rate.");
} else {
print_line("Requested V-Sync mode: Disabled");
}
}
#ifdef UNIX_ENABLED #ifdef UNIX_ENABLED
// Print warning before initializing audio. // Print warning before initializing audio.
if (OS::get_singleton()->get_environment("USER") == "root" && !OS::get_singleton()->has_environment("GODOT_SILENCE_ROOT_WARNING")) { if (OS::get_singleton()->get_environment("USER") == "root" && !OS::get_singleton()->has_environment("GODOT_SILENCE_ROOT_WARNING")) {