summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_vulkan/vk_scheduler.cpp6
-rw-r--r--src/video_core/renderer_vulkan/vk_scheduler.h4
2 files changed, 6 insertions, 4 deletions
diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp
index 3bfdf41ba..7d9d4f7ba 100644
--- a/src/video_core/renderer_vulkan/vk_scheduler.cpp
+++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp
@@ -140,12 +140,12 @@ bool VKScheduler::UpdateRescaling(bool is_rescaling) {
140void VKScheduler::WorkerThread(std::stop_token stop_token) { 140void VKScheduler::WorkerThread(std::stop_token stop_token) {
141 Common::SetCurrentThreadName("yuzu:VulkanWorker"); 141 Common::SetCurrentThreadName("yuzu:VulkanWorker");
142 do { 142 do {
143 if (work_queue.empty()) {
144 wait_cv.notify_all();
145 }
146 std::unique_ptr<CommandChunk> work; 143 std::unique_ptr<CommandChunk> work;
147 { 144 {
148 std::unique_lock lock{work_mutex}; 145 std::unique_lock lock{work_mutex};
146 if (work_queue.empty()) {
147 wait_cv.notify_all();
148 }
149 work_cv.wait(lock, stop_token, [this] { return !work_queue.empty(); }); 149 work_cv.wait(lock, stop_token, [this] { return !work_queue.empty(); });
150 if (stop_token.stop_requested()) { 150 if (stop_token.stop_requested()) {
151 continue; 151 continue;
diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h
index 1b06c9296..e69aa136b 100644
--- a/src/video_core/renderer_vulkan/vk_scheduler.h
+++ b/src/video_core/renderer_vulkan/vk_scheduler.h
@@ -146,6 +146,7 @@ private:
146 using FuncType = TypedCommand<T>; 146 using FuncType = TypedCommand<T>;
147 static_assert(sizeof(FuncType) < sizeof(data), "Lambda is too large"); 147 static_assert(sizeof(FuncType) < sizeof(data), "Lambda is too large");
148 148
149 recorded_counts++;
149 command_offset = Common::AlignUp(command_offset, alignof(FuncType)); 150 command_offset = Common::AlignUp(command_offset, alignof(FuncType));
150 if (command_offset > sizeof(data) - sizeof(FuncType)) { 151 if (command_offset > sizeof(data) - sizeof(FuncType)) {
151 return false; 152 return false;
@@ -167,7 +168,7 @@ private:
167 } 168 }
168 169
169 bool Empty() const { 170 bool Empty() const {
170 return command_offset == 0; 171 return recorded_counts == 0;
171 } 172 }
172 173
173 bool HasSubmit() const { 174 bool HasSubmit() const {
@@ -178,6 +179,7 @@ private:
178 Command* first = nullptr; 179 Command* first = nullptr;
179 Command* last = nullptr; 180 Command* last = nullptr;
180 181
182 size_t recorded_counts = 0;
181 size_t command_offset = 0; 183 size_t command_offset = 0;
182 bool submit = false; 184 bool submit = false;
183 alignas(std::max_align_t) std::array<u8, 0x8000> data{}; 185 alignas(std::max_align_t) std::array<u8, 0x8000> data{};