From 3005983c51fa6da611e7ba5a93b5e96e4267cd6d Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Tue, 5 Oct 2021 01:33:40 +0200 Subject: [PATCH] early-access version 2107 --- README.md | 2 +- src/video_core/rasterizer_accelerated.h | 2 +- .../renderer_vulkan/vk_master_semaphore.h | 17 +++++++++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6c7135ac5..3ef83989d 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 2106. +This is the source code for early-access 2107. ## Legal Notice diff --git a/src/video_core/rasterizer_accelerated.h b/src/video_core/rasterizer_accelerated.h index ea879bfdd..249644e50 100755 --- a/src/video_core/rasterizer_accelerated.h +++ b/src/video_core/rasterizer_accelerated.h @@ -42,7 +42,7 @@ private: }; static_assert(sizeof(CacheEntry) == 8, "CacheEntry should be 8 bytes!"); - std::array cached_pages; + std::array cached_pages; Core::Memory::Memory& cpu_memory; }; diff --git a/src/video_core/renderer_vulkan/vk_master_semaphore.h b/src/video_core/renderer_vulkan/vk_master_semaphore.h index 4f8688118..0886b7da8 100755 --- a/src/video_core/renderer_vulkan/vk_master_semaphore.h +++ b/src/video_core/renderer_vulkan/vk_master_semaphore.h @@ -21,12 +21,12 @@ public: /// Returns the current logical tick. [[nodiscard]] u64 CurrentTick() const noexcept { - return current_tick.load(std::memory_order_relaxed); + return current_tick.load(std::memory_order_acquire); } /// Returns the last known GPU tick. [[nodiscard]] u64 KnownGpuTick() const noexcept { - return gpu_tick.load(std::memory_order_relaxed); + return gpu_tick.load(std::memory_order_acquire); } /// Returns the timeline semaphore handle. @@ -41,12 +41,21 @@ public: /// Advance to the logical tick and return the old one [[nodiscard]] u64 NextTick() noexcept { - return current_tick.fetch_add(1, std::memory_order::relaxed); + return current_tick.fetch_add(1, std::memory_order_release); } /// Refresh the known GPU tick void Refresh() { - gpu_tick.store(semaphore.GetCounter(), std::memory_order_relaxed); + u64 this_tick{}; + u64 counter{}; + do { + this_tick = gpu_tick.load(std::memory_order_acquire); + counter = semaphore.GetCounter(); + if (counter < this_tick) { + return; + } + } while (!gpu_tick.compare_exchange_weak(this_tick, counter, std::memory_order_release, + std::memory_order_relaxed)); } /// Waits for a tick to be hit on the GPU