diff --git a/rpcs3/Emu/RSX/GL/GLPresent.cpp b/rpcs3/Emu/RSX/GL/GLPresent.cpp index 0840419ffb..187e0f3b4d 100644 --- a/rpcs3/Emu/RSX/GL/GLPresent.cpp +++ b/rpcs3/Emu/RSX/GL/GLPresent.cpp @@ -201,6 +201,11 @@ void GLGSRender::flip(const rsx::display_flip_info_t& info) buffer_height = present_info.height; } + if (info.emu_flip) + { + evaluate_cpu_usage_reduction_limits(); + } + // Get window state const int width = m_frame->client_width(); const int height = m_frame->client_height(); diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index f9ef46efcd..8b5f470877 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -3493,8 +3493,6 @@ namespace rsx intr_thread->cmd_notify.notify_one(); } } - - evaluate_cpu_usage_reduction_limits(); } void thread::evaluate_cpu_usage_reduction_limits() @@ -3574,9 +3572,9 @@ namespace rsx const u64 cur_diff = (i == frame_times.size() ? current_time : frame_times[i].timestamp) - frame_times[i - 1].timestamp; if (const u64 diff_of_diff = abs_dst(cur_diff, avg_frame_time); - diff_of_diff >= avg_frame_time / 4) + diff_of_diff >= avg_frame_time / 7) { - if (diff_of_diff >= avg_frame_time / 2) + if (diff_of_diff >= avg_frame_time / 3) { highered_delay++; hard_fails++; @@ -3608,7 +3606,7 @@ namespace rsx preempt_count = 0; } - if (hard_fails > 2 && is_last_frame_a_fail) + if ((hard_fails > 2 || fails > 20) && is_last_frame_a_fail) { hard_measures_taken = preempt_count > 1; preempt_count = preempt_count * 7 / 8; @@ -3641,7 +3639,7 @@ namespace rsx } } // Sudden FPS drop detection - else if ((fails > 10 || hard_fails > 2 || !(abs_dst(fps_10, 300) < 20 || abs_dst(fps_10, 600) < 30 || abs_dst(fps_10, g_cfg.video.vblank_rate * 10) < 20 || abs_dst(fps_10, g_cfg.video.vblank_rate * 10 / 2) < 30)) && lowered_delay < highered_delay && is_last_frame_a_fail) + else if ((fails > 13 || hard_fails > 2 || !(abs_dst(fps_10, 300) < 20 || abs_dst(fps_10, 600) < 30 || abs_dst(fps_10, g_cfg.video.vblank_rate * 10) < 20 || abs_dst(fps_10, g_cfg.video.vblank_rate * 10 / 2) < 30)) && lowered_delay < highered_delay && is_last_frame_a_fail) { lower_preemption_count(); } diff --git a/rpcs3/Emu/RSX/RSXThread.h b/rpcs3/Emu/RSX/RSXThread.h index 7b7dc7492a..8cc4f9294e 100644 --- a/rpcs3/Emu/RSX/RSXThread.h +++ b/rpcs3/Emu/RSX/RSXThread.h @@ -800,11 +800,12 @@ namespace rsx */ void write_vertex_data_to_memory(const vertex_input_layout& layout, u32 first_vertex, u32 vertex_count, void *persistent_data, void *volatile_data); + void evaluate_cpu_usage_reduction_limits(); + private: shared_mutex m_mtx_task; void handle_emu_flip(u32 buffer); - void evaluate_cpu_usage_reduction_limits(); void handle_invalidated_memory_range(); public: diff --git a/rpcs3/Emu/RSX/VK/VKPresent.cpp b/rpcs3/Emu/RSX/VK/VKPresent.cpp index 32d7d92c4e..58a0965b25 100644 --- a/rpcs3/Emu/RSX/VK/VKPresent.cpp +++ b/rpcs3/Emu/RSX/VK/VKPresent.cpp @@ -503,6 +503,11 @@ void VKGSRender::flip(const rsx::display_flip_info_t& info) buffer_height = present_info.height; } + if (info.emu_flip) + { + evaluate_cpu_usage_reduction_limits(); + } + // Prepare surface for new frame. Set no timeout here so that we wait for the next image if need be ensure(m_current_frame->present_image == umax); ensure(m_current_frame->swap_command_buffer == nullptr);