From c5f5d6e7f6dadf16d2d175a0aaba58deacffa579 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 12 Apr 2021 09:33:26 -0400 Subject: vk_master_semaphore: Add missing const qualifier for IsFree() This member function doesn't modify class state. --- src/video_core/renderer_vulkan/vk_master_semaphore.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/video_core/renderer_vulkan/vk_master_semaphore.h b/src/video_core/renderer_vulkan/vk_master_semaphore.h index 2c7ed654d..60ffa6d97 100644 --- a/src/video_core/renderer_vulkan/vk_master_semaphore.h +++ b/src/video_core/renderer_vulkan/vk_master_semaphore.h @@ -35,7 +35,7 @@ public: } /// Returns true when a tick has been hit by the GPU. - [[nodiscard]] bool IsFree(u64 tick) { + [[nodiscard]] bool IsFree(u64 tick) const noexcept { return gpu_tick.load(std::memory_order_relaxed) >= tick; } -- cgit v1.2.3 From 9b331a5fb537336e4bbca575fde974d4e465c792 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 12 Apr 2021 09:41:53 -0400 Subject: vk_master_semaphore: Deduplicate atomic access within IsFree() We can just reuse the already existing KnownGpuTick() to deduplicate the access. --- src/video_core/renderer_vulkan/vk_master_semaphore.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/video_core/renderer_vulkan/vk_master_semaphore.h b/src/video_core/renderer_vulkan/vk_master_semaphore.h index 60ffa6d97..4b6d64daa 100644 --- a/src/video_core/renderer_vulkan/vk_master_semaphore.h +++ b/src/video_core/renderer_vulkan/vk_master_semaphore.h @@ -36,7 +36,7 @@ public: /// Returns true when a tick has been hit by the GPU. [[nodiscard]] bool IsFree(u64 tick) const noexcept { - return gpu_tick.load(std::memory_order_relaxed) >= tick; + return KnownGpuTick() >= tick; } /// Advance to the logical tick. -- cgit v1.2.3