Merge pull request #12451 from lioncash/fifo

VideoCommon/Fifo: Pass system instance through FifoManager constructor
This commit is contained in:
Tilka
2023-12-20 12:45:38 +00:00
committed by GitHub
10 changed files with 99 additions and 95 deletions

View File

@ -660,7 +660,7 @@ static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi
wiifs_guard.Dismiss();
// This adds the SyncGPU handler to CoreTiming, so now CoreTiming::Advance might block.
system.GetFifo().Prepare(system);
system.GetFifo().Prepare();
// Setup our core
if (Config::Get(Config::MAIN_CPU_CORE) != PowerPC::CPUCore::Interpreter)
@ -687,7 +687,7 @@ static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi
s_cpu_thread = std::thread(cpuThreadFunc, savestate_path, delete_savestate);
// become the GPU thread
system.GetFifo().RunGpuLoop(system);
system.GetFifo().RunGpuLoop();
// We have now exited the Video Loop
INFO_LOG_FMT(CONSOLE, "{}", StopMessage(false, "Video Loop Ended"));
@ -834,7 +834,7 @@ static bool PauseAndLock(Core::System& system, bool do_lock, bool unpause_on_unl
// video has to come after CPU, because CPU thread can wait for video thread
// (s_efbAccessRequested).
system.GetFifo().PauseAndLock(system, do_lock, false);
system.GetFifo().PauseAndLock(do_lock, false);
ResetRumble();
@ -1029,7 +1029,7 @@ void UpdateWantDeterminism(bool initial)
ios->UpdateWantDeterminism(new_want_determinism);
auto& system = Core::System::GetInstance();
system.GetFifo().UpdateWantDeterminism(system, new_want_determinism);
system.GetFifo().UpdateWantDeterminism(new_want_determinism);
// We need to clear the cache because some parts of the JIT depend on want_determinism,
// e.g. use of FMA.

View File

@ -466,17 +466,15 @@ void CoreTimingManager::AdjustEventQueueTimes(u32 new_ppc_clock, u32 old_ppc_clo
void CoreTimingManager::Idle()
{
auto& system = m_system;
auto& ppc_state = m_system.GetPPCState();
if (m_config_sync_on_skip_idle)
{
// When the FIFO is processing data we must not advance because in this way
// the VI will be desynchronized. So, We are waiting until the FIFO finish and
// while we process only the events required by the FIFO.
system.GetFifo().FlushGpu(system);
m_system.GetFifo().FlushGpu();
}
auto& ppc_state = m_system.GetPPCState();
PowerPC::UpdatePerformanceMonitor(ppc_state.downcount, 0, 0, ppc_state);
m_idled_cycles += DowncountToCycles(ppc_state.downcount);
ppc_state.downcount = 0;

View File

@ -42,9 +42,9 @@ struct System::Impl
{
explicit Impl(System& system)
: m_audio_interface(system), m_core_timing(system), m_cpu(system), m_dsp(system),
m_dvd_interface(system), m_dvd_thread(system), m_expansion_interface(system),
m_gp_fifo(system), m_memory(system), m_power_pc(system),
m_mmu(system, m_memory, m_power_pc), m_processor_interface(system),
m_dvd_interface(system), m_dvd_thread(system),
m_expansion_interface(system), m_fifo{system}, m_gp_fifo(system), m_memory(system),
m_power_pc(system), m_mmu(system, m_memory, m_power_pc), m_processor_interface(system),
m_serial_interface(system), m_video_interface(system),
m_interpreter(system, m_power_pc.GetPPCState(), m_mmu), m_jit_interface(system)
{