Fifo: only sleep once within every ms of emulated time

This commit is contained in:
degasus
2015-03-13 23:36:31 +01:00
parent b020ae1c5d
commit d2c62b1744
4 changed files with 15 additions and 3 deletions

View File

@ -369,9 +369,13 @@ void RunGpuLoop()
{
if (s_gpu_is_running.IsSet())
{
// reset the atomic flag. But as the CPU thread might have pushed some new data, we have to rerun the GPU loop
s_gpu_is_pending.Set();
s_gpu_is_running.Clear();
if (CommandProcessor::s_gpuMaySleep.IsSet())
{
// Reset the atomic flag. But as the CPU thread might have pushed some new data, we have to rerun the GPU loop
s_gpu_is_pending.Set();
s_gpu_is_running.Clear();
CommandProcessor::s_gpuMaySleep.Clear();
}
}
else
{
@ -403,6 +407,7 @@ void FlushGpu()
while (s_gpu_is_running.IsSet() || s_gpu_is_pending.IsSet())
{
CommandProcessor::s_gpuMaySleep.Set();
s_gpu_done_event.Wait();
}
}