summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Ameer J2021-10-16 21:37:43 -0400
committerGravatar GitHub2021-10-16 21:37:43 -0400
commit5b735a4c9dc14b63f68d8ef15f720e92f035f151 (patch)
tree5d7db8de5a5e40a4e5a6cf6756b2a2de31bdc466 /src
parentMerge pull request #7195 from MightyCreak/fix-warning-typo (diff)
parentVulkan: Fix failing barrier on refresh. (diff)
downloadyuzu-5b735a4c9dc14b63f68d8ef15f720e92f035f151.tar.gz
yuzu-5b735a4c9dc14b63f68d8ef15f720e92f035f151.tar.xz
yuzu-5b735a4c9dc14b63f68d8ef15f720e92f035f151.zip
Merge pull request #7127 from FernandoS27/i-saw-a-wabbit
A few fixes on Vulkan and Rasterizer Caching
Diffstat (limited to '')
-rw-r--r--src/video_core/rasterizer_accelerated.h2
-rw-r--r--src/video_core/renderer_vulkan/vk_master_semaphore.h17
2 files changed, 14 insertions, 5 deletions
diff --git a/src/video_core/rasterizer_accelerated.h b/src/video_core/rasterizer_accelerated.h
index ea879bfdd..249644e50 100644
--- a/src/video_core/rasterizer_accelerated.h
+++ b/src/video_core/rasterizer_accelerated.h
@@ -42,7 +42,7 @@ private:
42 }; 42 };
43 static_assert(sizeof(CacheEntry) == 8, "CacheEntry should be 8 bytes!"); 43 static_assert(sizeof(CacheEntry) == 8, "CacheEntry should be 8 bytes!");
44 44
45 std::array<CacheEntry, 0x1000000> cached_pages; 45 std::array<CacheEntry, 0x2000000> cached_pages;
46 Core::Memory::Memory& cpu_memory; 46 Core::Memory::Memory& cpu_memory;
47}; 47};
48 48
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 100644
--- 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:
21 21
22 /// Returns the current logical tick. 22 /// Returns the current logical tick.
23 [[nodiscard]] u64 CurrentTick() const noexcept { 23 [[nodiscard]] u64 CurrentTick() const noexcept {
24 return current_tick.load(std::memory_order_relaxed); 24 return current_tick.load(std::memory_order_acquire);
25 } 25 }
26 26
27 /// Returns the last known GPU tick. 27 /// Returns the last known GPU tick.
28 [[nodiscard]] u64 KnownGpuTick() const noexcept { 28 [[nodiscard]] u64 KnownGpuTick() const noexcept {
29 return gpu_tick.load(std::memory_order_relaxed); 29 return gpu_tick.load(std::memory_order_acquire);
30 } 30 }
31 31
32 /// Returns the timeline semaphore handle. 32 /// Returns the timeline semaphore handle.
@@ -41,12 +41,21 @@ public:
41 41
42 /// Advance to the logical tick and return the old one 42 /// Advance to the logical tick and return the old one
43 [[nodiscard]] u64 NextTick() noexcept { 43 [[nodiscard]] u64 NextTick() noexcept {
44 return current_tick.fetch_add(1, std::memory_order::relaxed); 44 return current_tick.fetch_add(1, std::memory_order_release);
45 } 45 }
46 46
47 /// Refresh the known GPU tick 47 /// Refresh the known GPU tick
48 void Refresh() { 48 void Refresh() {
49 gpu_tick.store(semaphore.GetCounter(), std::memory_order_relaxed); 49 u64 this_tick{};
50 u64 counter{};
51 do {
52 this_tick = gpu_tick.load(std::memory_order_acquire);
53 counter = semaphore.GetCounter();
54 if (counter < this_tick) {
55 return;
56 }
57 } while (!gpu_tick.compare_exchange_weak(this_tick, counter, std::memory_order_release,
58 std::memory_order_relaxed));
50 } 59 }
51 60
52 /// Waits for a tick to be hit on the GPU 61 /// Waits for a tick to be hit on the GPU