mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 11:36:13 +00:00
rsx: wait when emulation is paused
This decreases my cpu usage by to <1% during Emu.Pause()
This commit is contained in:
parent
1f1d1da87b
commit
14a425e487
1 changed files with 11 additions and 2 deletions
|
@ -555,7 +555,7 @@ namespace rsx
|
|||
on_exit();
|
||||
}
|
||||
|
||||
void thread::cpu_wait(bs_t<cpu_flag>)
|
||||
void thread::cpu_wait(bs_t<cpu_flag> old)
|
||||
{
|
||||
if (external_interrupt_lock)
|
||||
{
|
||||
|
@ -563,7 +563,16 @@ namespace rsx
|
|||
}
|
||||
|
||||
on_semaphore_acquire_wait();
|
||||
std::this_thread::yield();
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
void thread::on_task()
|
||||
|
|
Loading…
Add table
Reference in a new issue