summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/vk_master_semaphore.h
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2021-02-13 14:25:45 +0100
committerGitHub <noreply@github.com>2021-02-13 14:25:45 +0100
commit83227ad981aee7bff00b06788fdebff038505520 (patch)
tree9f386ef1ce5a5b78653b3661b4097dfc0f7f2849 /src/video_core/renderer_vulkan/vk_master_semaphore.h
parentMerge pull request #5915 from lat9nq/screenshots-dir-fix (diff)
parentvk_master_semaphore: Mark gpu_tick atomic operations with relaxed order (diff)
downloadyuzu-83227ad981aee7bff00b06788fdebff038505520.tar
yuzu-83227ad981aee7bff00b06788fdebff038505520.tar.gz
yuzu-83227ad981aee7bff00b06788fdebff038505520.tar.bz2
yuzu-83227ad981aee7bff00b06788fdebff038505520.tar.lz
yuzu-83227ad981aee7bff00b06788fdebff038505520.tar.xz
yuzu-83227ad981aee7bff00b06788fdebff038505520.tar.zst
yuzu-83227ad981aee7bff00b06788fdebff038505520.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_vulkan/vk_master_semaphore.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/video_core/renderer_vulkan/vk_master_semaphore.h b/src/video_core/renderer_vulkan/vk_master_semaphore.h
index f336f1862..2c7ed654d 100644
--- a/src/video_core/renderer_vulkan/vk_master_semaphore.h
+++ b/src/video_core/renderer_vulkan/vk_master_semaphore.h
@@ -21,7 +21,12 @@ public:
/// Returns the current logical tick.
[[nodiscard]] u64 CurrentTick() const noexcept {
- return current_tick;
+ return current_tick.load(std::memory_order_relaxed);
+ }
+
+ /// Returns the last known GPU tick.
+ [[nodiscard]] u64 KnownGpuTick() const noexcept {
+ return gpu_tick.load(std::memory_order_relaxed);
}
/// Returns the timeline semaphore handle.
@@ -31,7 +36,7 @@ public:
/// Returns true when a tick has been hit by the GPU.
[[nodiscard]] bool IsFree(u64 tick) {
- return gpu_tick >= tick;
+ return gpu_tick.load(std::memory_order_relaxed) >= tick;
}
/// Advance to the logical tick.
@@ -41,7 +46,7 @@ public:
/// Refresh the known GPU tick
void Refresh() {
- gpu_tick = semaphore.GetCounter();
+ gpu_tick.store(semaphore.GetCounter(), std::memory_order_relaxed);
}
/// Waits for a tick to be hit on the GPU