diff --git a/src/android/app/src/main/jni/emu_window/emu_window.cpp b/src/android/app/src/main/jni/emu_window/emu_window.cpp index 9858344639..f872875f99 100644 --- a/src/android/app/src/main/jni/emu_window/emu_window.cpp +++ b/src/android/app/src/main/jni/emu_window/emu_window.cpp @@ -212,27 +212,18 @@ void EmuWindow_Android::UpdateFrameRateHint() { using SetFrameRateWithChangeStrategyFn = int32_t (*)(ANativeWindow*, float, int8_t, int8_t); - using SetFrameRateFn = int32_t (*)(ANativeWindow*, float, int8_t); static const auto set_frame_rate_with_change_strategy = reinterpret_cast( dlsym(RTLD_DEFAULT, "ANativeWindow_setFrameRateWithChangeStrategy")); - static const auto set_frame_rate = reinterpret_cast( - dlsym(RTLD_DEFAULT, "ANativeWindow_setFrameRate")); - constexpr int8_t FrameRateCompatibilityDefault = 0; - constexpr int8_t ChangeFrameRateOnlyIfSeamless = 0; - - int32_t result = -1; - if (set_frame_rate_with_change_strategy) { - result = set_frame_rate_with_change_strategy(surface, frame_rate_hint, - FrameRateCompatibilityDefault, - ChangeFrameRateOnlyIfSeamless); - } else if (set_frame_rate) { - result = set_frame_rate(surface, frame_rate_hint, FrameRateCompatibilityDefault); - } else { + if (!set_frame_rate_with_change_strategy) { return; } + const auto result = set_frame_rate_with_change_strategy( + surface, frame_rate_hint, + static_cast(ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT), + static_cast(ANATIVEWINDOW_CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS)); if (result != 0) { LOG_DEBUG(Frontend, "Failed to update Android surface frame rate hint: {}", result); return; diff --git a/src/video_core/renderer_vulkan/vk_swapchain.cpp b/src/video_core/renderer_vulkan/vk_swapchain.cpp index dc95d9621e..46b98f6cc1 100644 --- a/src/video_core/renderer_vulkan/vk_swapchain.cpp +++ b/src/video_core/renderer_vulkan/vk_swapchain.cpp @@ -9,10 +9,6 @@ #include #include -#ifdef __ANDROID__ -#include -#endif - #include "common/logging/log.h" #include "common/settings.h" #include "common/settings_enums.h" @@ -174,7 +170,9 @@ bool Swapchain::AcquireNextImage() { break; } - const auto wait_with_frame_pacing = [this] { +#ifdef __ANDROID__ + scheduler.Wait(resource_ticks[image_index]); +#else switch (Settings::values.frame_pacing_mode.GetValue()) { case Settings::FramePacingMode::Target_Auto: scheduler.Wait(resource_ticks[image_index]); @@ -192,16 +190,6 @@ bool Swapchain::AcquireNextImage() { scheduler.Wait(resource_ticks[image_index], 120.0); break; } - }; - -#ifdef __ANDROID__ - if (android_get_device_api_level() >= 30) { - scheduler.Wait(resource_ticks[image_index]); - } else { - wait_with_frame_pacing(); - } -#else - wait_with_frame_pacing(); #endif resource_ticks[image_index] = scheduler.CurrentTick();