mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 15:45:42 +00:00
GPU/SW: Replace event with semaphore
This commit is contained in:
parent
89659db7ee
commit
eb166220b1
|
@ -200,8 +200,7 @@ void GPUBackend::Sync(bool allow_sleep)
|
||||||
PushCommand(cmd);
|
PushCommand(cmd);
|
||||||
WakeGPUThread();
|
WakeGPUThread();
|
||||||
|
|
||||||
m_sync_event.Wait();
|
m_sync_semaphore.Wait();
|
||||||
m_sync_event.Reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPUBackend::RunGPULoop()
|
void GPUBackend::RunGPULoop()
|
||||||
|
@ -252,7 +251,7 @@ void GPUBackend::RunGPULoop()
|
||||||
case GPUBackendCommandType::Sync:
|
case GPUBackendCommandType::Sync:
|
||||||
{
|
{
|
||||||
DebugAssert(read_ptr == write_ptr);
|
DebugAssert(read_ptr == write_ptr);
|
||||||
m_sync_event.Signal();
|
m_sync_semaphore.Post();
|
||||||
allow_sleep = static_cast<const GPUBackendSyncCommand*>(cmd)->allow_sleep;
|
allow_sleep = static_cast<const GPUBackendSyncCommand*>(cmd)->allow_sleep;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -66,7 +66,7 @@ protected:
|
||||||
|
|
||||||
Common::Rectangle<u32> m_drawing_area{};
|
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_thread_sleeping{false};
|
||||||
std::atomic_bool m_gpu_loop_done{false};
|
std::atomic_bool m_gpu_loop_done{false};
|
||||||
Threading::Thread m_gpu_thread;
|
Threading::Thread m_gpu_thread;
|
||||||
|
|
Loading…
Reference in a new issue