summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Fifo.cpp
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2021-04-18 11:17:25 -0400
committerGitHub <noreply@github.com>2021-04-18 11:17:25 -0400
commit821e51cda4153ad6ddd6c8ea6b98f8b2bead231c (patch)
tree32d1e4d02a22bf55389257c939b565a1449c369a /Source/Core/VideoCommon/Fifo.cpp
parentdbd39ab2a024670e1a1db7d906dd5d4487b15bb3 (diff)
parente3ac5dca3218e62636659624b65a9ff599fee150 (diff)
Merge pull request #7214 from stenzek/cp-access-sync
Fifo: Run/sync with the GPU on command processor register access
Diffstat (limited to 'Source/Core/VideoCommon/Fifo.cpp')
-rw-r--r--Source/Core/VideoCommon/Fifo.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/Fifo.cpp b/Source/Core/VideoCommon/Fifo.cpp
index 57dcb07c85..5aede12b96 100644
--- a/Source/Core/VideoCommon/Fifo.cpp
+++ b/Source/Core/VideoCommon/Fifo.cpp
@@ -580,6 +580,16 @@ static void SyncGPUCallback(u64 ticks, s64 cyclesLate)
CoreTiming::ScheduleEvent(next, s_event_sync_gpu, next);
}
+void SyncGPUForRegisterAccess()
+{
+ SyncGPU(SyncGPUReason::Other);
+
+ if (!SConfig::GetInstance().bCPUThread || s_use_deterministic_gpu_thread)
+ RunGpuOnCpu(GPU_TIME_SLOT_SIZE);
+ else if (SConfig::GetInstance().bSyncGPU)
+ WaitForGpuThread(GPU_TIME_SLOT_SIZE);
+}
+
// Initialize GPU - CPU thread syncing, this gives us a deterministic way to start the GPU thread.
void Prepare()
{