GPU/SW: Replace event with semaphore

This commit is contained in:
Connor McLaughlin 2022-07-30 21:49:56 +10:00
parent 89659db7ee
commit eb166220b1
2 changed files with 3 additions and 4 deletions

View File

@ -200,8 +200,7 @@ void GPUBackend::Sync(bool allow_sleep)
PushCommand(cmd);
WakeGPUThread();
m_sync_event.Wait();
m_sync_event.Reset();
m_sync_semaphore.Wait();
}
void GPUBackend::RunGPULoop()
@ -252,7 +251,7 @@ void GPUBackend::RunGPULoop()
case GPUBackendCommandType::Sync:
{
DebugAssert(read_ptr == write_ptr);
m_sync_event.Signal();
m_sync_semaphore.Post();
allow_sleep = static_cast<const GPUBackendSyncCommand*>(cmd)->allow_sleep;
}
break;

View File

@ -66,7 +66,7 @@ protected:
Common::Rectangle<u32> m_drawing_area{};
Common::Event m_sync_event;
Threading::KernelSemaphore m_sync_semaphore;
std::atomic_bool m_gpu_thread_sleeping{false};
std::atomic_bool m_gpu_loop_done{false};
Threading::Thread m_gpu_thread;