VideoCommon: use a new async event system for efb access

This commit is contained in:
degasus
2015-01-31 11:38:23 +01:00
parent 860c889454
commit bc248f8941
10 changed files with 201 additions and 58 deletions

View File

@ -15,6 +15,7 @@
#include "Core/NetPlayProto.h"
#include "Core/HW/Memmap.h"
#include "VideoCommon/AsyncRequests.h"
#include "VideoCommon/CommandProcessor.h"
#include "VideoCommon/CPMemory.h"
#include "VideoCommon/DataReader.h"
@ -282,11 +283,14 @@ void RunGpuLoop()
// 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;
AsyncRequests::GetInstance()->SetEnable(true);
while (GpuRunningState)
{
g_video_backend->PeekMessages();
VideoFifo_CheckAsyncRequest();
AsyncRequests::GetInstance()->PullEvents();
if (g_use_deterministic_gpu_thread)
{
// All the fifo/CP stuff is on the CPU. We just need to run the opcode decoder.
@ -349,6 +353,7 @@ void RunGpuLoop()
// If we don't, s_swapRequested or s_efbAccessRequested won't be set to false
// leading the CPU thread to wait in Video_BeginField or Video_AccessEFB thus slowing things down.
VideoFifo_CheckAsyncRequest();
AsyncRequests::GetInstance()->PullEvents();
CommandProcessor::isPossibleWaitingSetDrawDone = false;
}
@ -377,6 +382,7 @@ void RunGpuLoop()
}
// wake up SyncGPU if we were interrupted
s_video_buffer_cond.notify_all();
AsyncRequests::GetInstance()->SetEnable(false);
}