mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-02 19:12:47 +02:00
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.
This commit is contained in:
parent
b33be736cd
commit
daefb3b550
@ -279,7 +279,7 @@ namespace this_thread
|
|||||||
inline void yield()
|
inline void yield()
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
Sleep(0);
|
SwitchToThread();
|
||||||
#else
|
#else
|
||||||
sleep(0);
|
sleep(0);
|
||||||
#endif
|
#endif
|
||||||
|
@ -171,14 +171,22 @@ void RunGpuLoop()
|
|||||||
CommandProcessor::isPossibleWaitingSetDrawDone = false;
|
CommandProcessor::isPossibleWaitingSetDrawDone = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
fifo.isGpuReadingData = false;
|
|
||||||
|
|
||||||
|
|
||||||
if (EmuRunningState)
|
if (EmuRunningState)
|
||||||
Common::YieldCPU();
|
{
|
||||||
|
if (fifo.isGpuReadingData)
|
||||||
|
{
|
||||||
|
fifo.isGpuReadingData = false;
|
||||||
|
Common::YieldCPU();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SLEEP(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// While the emu is paused, we still handle async request such as Savestates then sleep.
|
// While the emu is paused, we still handle async request such as Savestates then sleep.
|
||||||
|
fifo.isGpuReadingData = false;
|
||||||
while (!EmuRunningState)
|
while (!EmuRunningState)
|
||||||
{
|
{
|
||||||
g_video_backend->PeekMessages();
|
g_video_backend->PeekMessages();
|
||||||
|
Loading…
Reference in New Issue
Block a user