diff options
author | Ameer J <52414509+ameerj@users.noreply.github.com> | 2023-08-06 20:55:05 +0200 |
---|---|---|
committer | Ameer J <52414509+ameerj@users.noreply.github.com> | 2023-08-06 20:55:05 +0200 |
commit | 9058486b9b9833d0554d3e3f11a582859657b21f (patch) | |
tree | fe16d174b54119a593b43c01f89c8ff1d4e1f3cf | |
parent | HACK: Avoid swizzling and reuploading ASTC image every frame (diff) | |
download | yuzu-9058486b9b9833d0554d3e3f11a582859657b21f.tar yuzu-9058486b9b9833d0554d3e3f11a582859657b21f.tar.gz yuzu-9058486b9b9833d0554d3e3f11a582859657b21f.tar.bz2 yuzu-9058486b9b9833d0554d3e3f11a582859657b21f.tar.lz yuzu-9058486b9b9833d0554d3e3f11a582859657b21f.tar.xz yuzu-9058486b9b9833d0554d3e3f11a582859657b21f.tar.zst yuzu-9058486b9b9833d0554d3e3f11a582859657b21f.zip |
-rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 9 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp | 1 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 10 | ||||
-rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 14 | ||||
-rw-r--r-- | src/video_core/textures/decoders.cpp | 9 |
5 files changed, 4 insertions, 39 deletions
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 9ca544ec9..9cafd2983 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp @@ -554,14 +554,7 @@ void TextureCacheRuntime::Finish() { } StagingBufferMap TextureCacheRuntime::UploadStagingBuffer(size_t 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; + return staging_buffer_pool.RequestUploadBuffer(size); } 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 27328dab2..ce92f66ab 100644 --- a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp @@ -214,7 +214,6 @@ 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 51be57b19..b3e17c332 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -846,15 +846,7 @@ void TextureCacheRuntime::Finish() { } StagingBufferRef TextureCacheRuntime::UploadStagingBuffer(size_t size) { - 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; + return staging_buffer_pool.Request(size, MemoryUsage::Upload); } 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 6b87987de..4457b366f 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -1021,18 +1021,8 @@ void TextureCache<P>::UploadImageContents(Image& image, StagingBuffer& staging) const GPUVAddr gpu_addr = image.gpu_addr; if (True(image.flags & ImageFlagBits::AcceleratedUpload)) { - 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); - } + 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 dde4b0904..95bcdd37b 100644 --- a/src/video_core/textures/decoders.cpp +++ b/src/video_core/textures/decoders.cpp @@ -88,7 +88,6 @@ void SwizzleImpl(std::span<u8> output, std::span<const u8> input, u32 width, u32 } } - template <bool TO_LINEAR, u32 BYTES_PER_PIXEL> void SwizzleSubrectImpl(std::span<u8> output, std::span<const u8> input, u32 width, u32 height, u32 depth, u32 origin_x, u32 origin_y, u32 extent_x, u32 num_lines, @@ -96,14 +95,6 @@ void SwizzleSubrectImpl(std::span<u8> output, std::span<const u8> input, u32 wid // The origin of the transformation can be configured here, leave it as zero as the current API // doesn't expose it. static constexpr u32 origin_z = 0; - static u32 last_width = 0; - static u32 last_height = 0; - if (last_width == width && last_height == height) { - return; - } - LOG_ERROR(Debug, "Called"); - last_width = width; - last_height = height; // We can configure here a custom pitch // As it's not exposed 'width * BYTES_PER_PIXEL' will be the expected pitch. |