diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-02-13 09:13:29 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-02-13 09:14:11 +0100 |
commit | 6171566296154963933fb8553c15b5316b5dda2f (patch) | |
tree | 1701d8363c0da07c7eda13929328e5a08e7f82cb /src | |
parent | gl_stream_buffer/vk_staging_buffer_pool: Fix size check (diff) | |
download | yuzu-6171566296154963933fb8553c15b5316b5dda2f.tar yuzu-6171566296154963933fb8553c15b5316b5dda2f.tar.gz yuzu-6171566296154963933fb8553c15b5316b5dda2f.tar.bz2 yuzu-6171566296154963933fb8553c15b5316b5dda2f.tar.lz yuzu-6171566296154963933fb8553c15b5316b5dda2f.tar.xz yuzu-6171566296154963933fb8553c15b5316b5dda2f.tar.zst yuzu-6171566296154963933fb8553c15b5316b5dda2f.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_master_semaphore.h | 5 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp | 3 |
2 files changed, 7 insertions, 1 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..33216d24a 100644 --- a/src/video_core/renderer_vulkan/vk_master_semaphore.h +++ b/src/video_core/renderer_vulkan/vk_master_semaphore.h @@ -24,6 +24,11 @@ public: return current_tick; } + /// Returns the last known GPU tick. + [[nodiscard]] u64 KnownGpuTick() const noexcept { + return gpu_tick; + } + /// Returns the timeline semaphore handle. [[nodiscard]] VkSemaphore Handle() const noexcept { return *semaphore; diff --git a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp index 9b5786fcb..7a1232497 100644 --- a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp @@ -175,8 +175,9 @@ StagingBufferRef StagingBufferPool::GetStreamBuffer(size_t size) { } bool StagingBufferPool::AreRegionsActive(size_t region_begin, size_t region_end) const { + const u64 gpu_tick = scheduler.GetMasterSemaphore().KnownGpuTick(); return std::any_of(sync_ticks.begin() + region_begin, sync_ticks.begin() + region_end, - [this](u64 sync_tick) { return !scheduler.IsFree(sync_tick); }); + [gpu_tick](u64 sync_tick) { return gpu_tick < sync_tick; }); }; StagingBufferRef StagingBufferPool::GetStagingBuffer(size_t size, MemoryUsage usage) { |