From 77af525ed6fde08aa19da6e500bf8c06197c0032 Mon Sep 17 00:00:00 2001 From: IndecisiveTurtle <47210458+raphaelthegreat@users.noreply.github.com> Date: Wed, 4 Sep 2024 17:00:22 +0300 Subject: [PATCH] buffer_cache: Dont skip cpu uploads with image sync * Sometimes image does not fully overlap with a region --- src/video_core/buffer_cache/buffer_cache.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/video_core/buffer_cache/buffer_cache.cpp b/src/video_core/buffer_cache/buffer_cache.cpp index 6a32e8fb5..e0caa5d82 100644 --- a/src/video_core/buffer_cache/buffer_cache.cpp +++ b/src/video_core/buffer_cache/buffer_cache.cpp @@ -466,10 +466,6 @@ void BufferCache::ChangeRegister(BufferId buffer_id) { void BufferCache::SynchronizeBuffer(Buffer& buffer, VAddr device_addr, u32 size, bool is_texel_buffer) { std::scoped_lock lk{mutex}; - if (is_texel_buffer && SynchronizeBufferFromImage(buffer, device_addr, size)) { - return; - } - boost::container::small_vector copies; u64 total_size_bytes = 0; u64 largest_copy = 0; @@ -488,6 +484,11 @@ void BufferCache::SynchronizeBuffer(Buffer& buffer, VAddr device_addr, u32 size, // Prevent uploading to gpu modified regions. // gpu_modified_ranges.ForEachNotInRange(device_addr_out, range_size, add_copy); }); + SCOPE_EXIT { + if (is_texel_buffer) { + SynchronizeBufferFromImage(buffer, device_addr, size); + } + }; if (total_size_bytes == 0) { return; }