diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-01-31 17:08:08 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-01-31 17:08:08 +0100 |
commit | 35ed051742125b9fd3b314ce5241075ae658e4a5 (patch) | |
tree | 6aef02414e37959d76e6c430dcb4ed1372481bb8 /src | |
parent | Merge pull request #7791 from german77/wall_clock (diff) | |
download | yuzu-35ed051742125b9fd3b314ce5241075ae658e4a5.tar yuzu-35ed051742125b9fd3b314ce5241075ae658e4a5.tar.gz yuzu-35ed051742125b9fd3b314ce5241075ae658e4a5.tar.bz2 yuzu-35ed051742125b9fd3b314ce5241075ae658e4a5.tar.lz yuzu-35ed051742125b9fd3b314ce5241075ae658e4a5.tar.xz yuzu-35ed051742125b9fd3b314ce5241075ae658e4a5.tar.zst yuzu-35ed051742125b9fd3b314ce5241075ae658e4a5.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_scheduler.cpp | 6 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_scheduler.h | 4 |
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) { void VKScheduler::WorkerThread(std::stop_token stop_token) { Common::SetCurrentThreadName("yuzu:VulkanWorker"); do { - if (work_queue.empty()) { - wait_cv.notify_all(); - } std::unique_ptr<CommandChunk> work; { std::unique_lock lock{work_mutex}; + if (work_queue.empty()) { + wait_cv.notify_all(); + } work_cv.wait(lock, stop_token, [this] { return !work_queue.empty(); }); if (stop_token.stop_requested()) { 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: using FuncType = TypedCommand<T>; static_assert(sizeof(FuncType) < sizeof(data), "Lambda is too large"); + recorded_counts++; command_offset = Common::AlignUp(command_offset, alignof(FuncType)); if (command_offset > sizeof(data) - sizeof(FuncType)) { return false; @@ -167,7 +168,7 @@ private: } bool Empty() const { - return command_offset == 0; + return recorded_counts == 0; } bool HasSubmit() const { @@ -178,6 +179,7 @@ private: Command* first = nullptr; Command* last = nullptr; + size_t recorded_counts = 0; size_t command_offset = 0; bool submit = false; alignas(std::max_align_t) std::array<u8, 0x8000> data{}; |