1
0
mirror of https://git.suyu.dev/suyu/suyu synced 2025-08-24 21:16:49 -05:00

Merge pull request #9975 from liamwhite/more-waiting

vulkan: fix more excessive waiting in scheduler
This commit is contained in:
Morph
2023-03-24 00:19:43 -04:00
committed by GitHub

View File

@@ -65,12 +65,13 @@ void Scheduler::WaitWorker() {
DispatchWork(); DispatchWork();
// Ensure the queue is drained. // Ensure the queue is drained.
std::unique_lock ql{queue_mutex}; {
event_cv.wait(ql, [this] { return work_queue.empty(); }); std::unique_lock ql{queue_mutex};
event_cv.wait(ql, [this] { return work_queue.empty(); });
}
// Now wait for execution to finish. // Now wait for execution to finish.
// This needs to be done in the same order as WorkerThread. std::scoped_lock el{execution_mutex};
std::unique_lock el{execution_mutex};
} }
void Scheduler::DispatchWork() { void Scheduler::DispatchWork() {