diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 9cafd2983b..9ca544ec90 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp @@ -554,7 +554,14 @@ void TextureCacheRuntime::Finish() { } StagingBufferMap TextureCacheRuntime::UploadStagingBuffer(size_t size) { - return staging_buffer_pool.RequestUploadBuffer(size); + static StagingBufferMap result; + static size_t last_size = 0; + if (size == last_size) { + return result; + } + last_size = size; + result = staging_buffer_pool.RequestUploadBuffer(size); + return result; } StagingBufferMap TextureCacheRuntime::DownloadStagingBuffer(size_t size) { 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 ce92f66ab5..27328dab29 100644 --- a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp @@ -214,6 +214,7 @@ StagingBufferPool::StagingBuffersCache& StagingBufferPool::GetCache(MemoryUsage } void StagingBufferPool::ReleaseCache(MemoryUsage usage) { + return; ReleaseLevel(GetCache(usage), current_delete_level); } diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index b3e17c3327..51be57b19e 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -846,7 +846,15 @@ void TextureCacheRuntime::Finish() { } StagingBufferRef TextureCacheRuntime::UploadStagingBuffer(size_t size) { - return staging_buffer_pool.Request(size, MemoryUsage::Upload); + static StagingBufferRef result; + static size_t last_size = 0; + if (size == last_size) { + return result; + } + LOG_ERROR(Debug, "Called"); + last_size = size; + result = staging_buffer_pool.Request(size, MemoryUsage::Upload); + return result; } StagingBufferRef TextureCacheRuntime::DownloadStagingBuffer(size_t size, bool deferred) { diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 4457b366f1..6b87987de1 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -1021,8 +1021,18 @@ void TextureCache
::UploadImageContents(Image& image, StagingBuffer& staging)
const GPUVAddr gpu_addr = image.gpu_addr;
if (True(image.flags & ImageFlagBits::AcceleratedUpload)) {
- gpu_memory->ReadBlock(gpu_addr, mapped_span.data(), mapped_span.size_bytes(),
- VideoCommon::CacheType::NoTextureCache);
+ static u64 last_size = 0;
+ bool has_run = false;
+ if (last_size == image.unswizzled_size_bytes) {
+ has_run = true;
+ }
+ last_size = image.unswizzled_size_bytes;
+
+ if (!has_run) {
+ LOG_ERROR(Debug, "Called");
+ gpu_memory->ReadBlock(gpu_addr, mapped_span.data(), mapped_span.size_bytes(),
+ VideoCommon::CacheType::NoTextureCache);
+ }
const auto uploads = FullUploadSwizzles(image.info);
runtime.AccelerateImageUpload(image, staging, uploads);
return;
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp
index 95bcdd37b2..dde4b0904f 100644
--- a/src/video_core/textures/decoders.cpp
+++ b/src/video_core/textures/decoders.cpp
@@ -88,6 +88,7 @@ void SwizzleImpl(std::span