diff options
| author | nitsuja <nitsuja-@hotmail.com> | 2012-01-07 20:22:48 -0800 |
|---|---|---|
| committer | nitsuja <nitsuja-@hotmail.com> | 2012-01-07 20:22:48 -0800 |
| commit | daefb3b550e27f291beb78aaea2bc9c9dc77ac78 (patch) | |
| tree | 223136bf543a74c4f3109a3e8571fa5285c1edae /Source/Core/VideoCommon | |
| parent | b33be736cd41292c964611385c1dc792364a1119 (diff) | |
a small thread synchronization speedup for dual core mode.
it's most noticeable in games where the CPU is running behind compared to the GPU.
Diffstat (limited to 'Source/Core/VideoCommon')
| -rw-r--r-- | Source/Core/VideoCommon/Src/Fifo.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/Src/Fifo.cpp b/Source/Core/VideoCommon/Src/Fifo.cpp index 842ff49e78..7330169ddd 100644 --- a/Source/Core/VideoCommon/Src/Fifo.cpp +++ b/Source/Core/VideoCommon/Src/Fifo.cpp @@ -171,14 +171,22 @@ void RunGpuLoop() CommandProcessor::isPossibleWaitingSetDrawDone = false; } - fifo.isGpuReadingData = false; - - if (EmuRunningState) - Common::YieldCPU(); + { + if (fifo.isGpuReadingData) + { + fifo.isGpuReadingData = false; + Common::YieldCPU(); + } + else + { + SLEEP(1); + } + } else { // While the emu is paused, we still handle async request such as Savestates then sleep. + fifo.isGpuReadingData = false; while (!EmuRunningState) { g_video_backend->PeekMessages(); |
