rsx: wait when emulation is paused

This decreases my cpu usage by to <1% during Emu.Pause()
This commit is contained in:
Megamouse 2021-09-07 23:39:39 +02:00
parent 1f1d1da87b
commit 14a425e487

View file

@ -555,7 +555,7 @@ namespace rsx
on_exit(); on_exit();
} }
void thread::cpu_wait(bs_t<cpu_flag>) void thread::cpu_wait(bs_t<cpu_flag> old)
{ {
if (external_interrupt_lock) if (external_interrupt_lock)
{ {
@ -563,8 +563,17 @@ namespace rsx
} }
on_semaphore_acquire_wait(); on_semaphore_acquire_wait();
if ((state & (cpu_flag::dbg_global_pause + cpu_flag::exit)) == cpu_flag::dbg_global_pause)
{
// Wait 16ms during emulation pause. This reduces cpu load while still giving us the chance to render overlays.
thread_ctrl::wait_on(state, old, 16000);
}
else
{
std::this_thread::yield(); std::this_thread::yield();
} }
}
void thread::on_task() void thread::on_task()
{ {