mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
Merge pull request #14035 from Dentomologist/pauseandlock_refactoring
PauseAndLock Refactoring
This commit is contained in:
@@ -67,23 +67,21 @@ void FifoManager::DoState(PointerWrap& p)
|
||||
p.Do(m_syncing_suspended);
|
||||
}
|
||||
|
||||
void FifoManager::PauseAndLock(bool do_lock, bool unpause_on_unlock)
|
||||
void FifoManager::PauseAndLock()
|
||||
{
|
||||
if (do_lock)
|
||||
{
|
||||
SyncGPU(SyncGPUReason::Other);
|
||||
EmulatorState(false);
|
||||
SyncGPU(SyncGPUReason::Other);
|
||||
EmulatorState(false);
|
||||
|
||||
if (!m_system.IsDualCoreMode() || m_use_deterministic_gpu_thread)
|
||||
return;
|
||||
if (!m_system.IsDualCoreMode() || m_use_deterministic_gpu_thread)
|
||||
return;
|
||||
|
||||
m_gpu_mainloop.WaitYield(std::chrono::milliseconds(100), Host_YieldToUI);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (unpause_on_unlock)
|
||||
EmulatorState(true);
|
||||
}
|
||||
m_gpu_mainloop.WaitYield(std::chrono::milliseconds(100), Host_YieldToUI);
|
||||
}
|
||||
|
||||
void FifoManager::RestoreState(const bool was_running)
|
||||
{
|
||||
if (was_running)
|
||||
EmulatorState(true);
|
||||
}
|
||||
|
||||
void FifoManager::Init()
|
||||
|
||||
@@ -52,7 +52,8 @@ public:
|
||||
void Shutdown();
|
||||
void Prepare(); // Must be called from the CPU thread.
|
||||
void DoState(PointerWrap& f);
|
||||
void PauseAndLock(bool do_lock, bool unpause_on_unlock);
|
||||
void PauseAndLock();
|
||||
void RestoreState(bool was_running);
|
||||
void UpdateWantDeterminism(bool want);
|
||||
bool UseDeterministicGPUThread() const { return m_use_deterministic_gpu_thread; }
|
||||
bool UseSyncGPU() const { return m_config_sync_gpu; }
|
||||
|
||||
@@ -64,13 +64,13 @@ void VideoConfig::Refresh()
|
||||
|
||||
const bool lock_gpu_thread = Core::IsRunning(system);
|
||||
if (lock_gpu_thread)
|
||||
system.GetFifo().PauseAndLock(true, false);
|
||||
system.GetFifo().PauseAndLock();
|
||||
|
||||
g_Config.Refresh();
|
||||
g_Config.VerifyValidity();
|
||||
|
||||
if (lock_gpu_thread)
|
||||
system.GetFifo().PauseAndLock(false, true);
|
||||
system.GetFifo().RestoreState(true);
|
||||
};
|
||||
|
||||
s_config_changed_callback_id =
|
||||
|
||||
Reference in New Issue
Block a user