summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Morph2023-03-24 00:19:43 -0400
committerGravatar GitHub2023-03-24 00:19:43 -0400
commit7a8a7545f2e50b04f0b1d3fdb09bc24275cc09d0 (patch)
tree632f33e32988853831e45af61fefc90e59dec30b
parentMerge pull request #9971 from Morph1984/q (diff)
parentvulkan: fix more excessive waiting in scheduler (diff)
downloadyuzu-7a8a7545f2e50b04f0b1d3fdb09bc24275cc09d0.tar.gz
yuzu-7a8a7545f2e50b04f0b1d3fdb09bc24275cc09d0.tar.xz
yuzu-7a8a7545f2e50b04f0b1d3fdb09bc24275cc09d0.zip
Merge pull request #9975 from liamwhite/more-waiting
vulkan: fix more excessive waiting in scheduler
-rw-r--r--src/video_core/renderer_vulkan/vk_scheduler.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp
index c636a1625..55e699552 100644
--- a/src/video_core/renderer_vulkan/vk_scheduler.cpp
+++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp
@@ -65,12 +65,13 @@ void Scheduler::WaitWorker() {
65 DispatchWork(); 65 DispatchWork();
66 66
67 // Ensure the queue is drained. 67 // Ensure the queue is drained.
68 std::unique_lock ql{queue_mutex}; 68 {
69 event_cv.wait(ql, [this] { return work_queue.empty(); }); 69 std::unique_lock ql{queue_mutex};
70 event_cv.wait(ql, [this] { return work_queue.empty(); });
71 }
70 72
71 // Now wait for execution to finish. 73 // Now wait for execution to finish.
72 // This needs to be done in the same order as WorkerThread. 74 std::scoped_lock el{execution_mutex};
73 std::unique_lock el{execution_mutex};
74} 75}
75 76
76void Scheduler::DispatchWork() { 77void Scheduler::DispatchWork() {