diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-05-07 05:29:08 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:30 +0200 |
commit | a51503660435f1279ce0fa449f9cf76e74b45d74 (patch) | |
tree | 5dd6b0da51add0c51d09241553260d81a2a9689f /src/video_core | |
parent | glasm: Add GLASM backend infrastructure (diff) | |
download | yuzu-a51503660435f1279ce0fa449f9cf76e74b45d74.tar yuzu-a51503660435f1279ce0fa449f9cf76e74b45d74.tar.gz yuzu-a51503660435f1279ce0fa449f9cf76e74b45d74.tar.bz2 yuzu-a51503660435f1279ce0fa449f9cf76e74b45d74.tar.lz yuzu-a51503660435f1279ce0fa449f9cf76e74b45d74.tar.xz yuzu-a51503660435f1279ce0fa449f9cf76e74b45d74.tar.zst yuzu-a51503660435f1279ce0fa449f9cf76e74b45d74.zip |
Diffstat (limited to 'src/video_core')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_master_semaphore.h | 6 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_scheduler.cpp | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/video_core/renderer_vulkan/vk_master_semaphore.h b/src/video_core/renderer_vulkan/vk_master_semaphore.h index ee3cd35d0..4f8688118 100644 --- a/src/video_core/renderer_vulkan/vk_master_semaphore.h +++ b/src/video_core/renderer_vulkan/vk_master_semaphore.h @@ -39,9 +39,9 @@ public: return KnownGpuTick() >= tick; } - /// Advance to the logical tick. - void NextTick() noexcept { - ++current_tick; + /// Advance to the logical tick and return the old one + [[nodiscard]] u64 NextTick() noexcept { + return current_tick.fetch_add(1, std::memory_order::relaxed); } /// Refresh the known GPU tick diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index 81cb330d9..fcb6a5911 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -168,9 +168,7 @@ void VKScheduler::SubmitExecution(VkSemaphore semaphore) { EndPendingOperations(); InvalidateState(); - const u64 signal_value = master_semaphore->CurrentTick(); - master_semaphore->NextTick(); - + const u64 signal_value = master_semaphore->NextTick(); Record([semaphore, signal_value, this](vk::CommandBuffer cmdbuf) { cmdbuf.End(); |