diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2014-12-09 02:22:27 -0600 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2014-12-09 02:22:27 -0600 |
| commit | 0578ec92c0b4c289820ad006f725377a04fe0574 (patch) | |
| tree | 5832e59e3b6fd8ca01849f431fc753617d73ed5d /Source/Core/VideoCommon/Fifo.cpp | |
| parent | 1ce3696e8be5ed4398c032022184d9fceda81124 (diff) | |
| parent | d58bba21604a34782791045ebf0f83f7d0f80da1 (diff) | |
Merge pull request #1665 from Sonicadvance1/yielding_the_dual_core_world
Idle loop in GPU loop on dual core systems.
Diffstat (limited to 'Source/Core/VideoCommon/Fifo.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Fifo.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/Fifo.cpp b/Source/Core/VideoCommon/Fifo.cpp index 18475a737c..ead6241fde 100644 --- a/Source/Core/VideoCommon/Fifo.cpp +++ b/Source/Core/VideoCommon/Fifo.cpp @@ -4,6 +4,7 @@ #include "Common/Atomic.h" #include "Common/ChunkFile.h" +#include "Common/CPUDetect.h" #include "Common/FPURoundMode.h" #include "Common/MemoryUtil.h" #include "Common/Thread.h" @@ -276,6 +277,10 @@ void RunGpuLoop() SCPFifoStruct &fifo = CommandProcessor::fifo; u32 cyclesExecuted = 0; + // If the host CPU has only two cores, idle loop instead of busy loop + // This allows a system that we are maxing out in dual core mode to do other things + bool yield_cpu = cpu_info.num_cores <= 2; + while (GpuRunningState) { g_video_backend->PeekMessages(); @@ -354,9 +359,8 @@ void RunGpuLoop() // NOTE(jsd): Calling SwitchToThread() on Windows 7 x64 is a hot spot, according to profiler. // See https://docs.google.com/spreadsheet/ccc?key=0Ah4nh0yGtjrgdFpDeF9pS3V6RUotRVE3S3J4TGM1NlE#gid=0 // for benchmark details. -#if 0 - Common::YieldCPU(); -#endif + if (yield_cpu) + Common::YieldCPU(); } else { |
