From e02a55d571a1b06e3510f2cadae38eed1bcb99e0 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Sun, 16 Jan 2022 09:55:54 +0100 Subject: [PATCH] early-access version 2402 --- README.md | 2 +- src/video_core/buffer_cache/buffer_cache.h | 6 +++--- src/video_core/renderer_opengl/gl_texture_cache.cpp | 2 +- src/video_core/renderer_vulkan/vk_texture_cache.cpp | 2 +- src/video_core/texture_cache/image_base.h | 10 +++++----- src/video_core/texture_cache/texture_cache.h | 11 ++++++----- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index b4121654d..ca4098df6 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 2401. +This is the source code for early-access 2402. ## Legal Notice diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 59c70a848..e6cd73d46 100755 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -464,9 +464,9 @@ BufferCache

::BufferCache(VideoCore::RasterizerInterface& rasterizer_, const s64 device_memory = static_cast(runtime.GetDeviceLocalMemory()); const s64 min_spacing_expected = device_memory - 1_GiB - 512_MiB; const s64 min_spacing_critical = device_memory - 1_GiB; - const s64 mem_tresshold = std::min(device_memory, TARGET_THRESHOLD); - const s64 min_vacancy_expected = (6 * mem_tresshold) / 10; - const s64 min_vacancy_critical = (3 * mem_tresshold) / 10; + const s64 mem_threshold = std::min(device_memory, TARGET_THRESHOLD); + const s64 min_vacancy_expected = (6 * mem_threshold) / 10; + const s64 min_vacancy_critical = (3 * mem_threshold) / 10; minimum_memory = static_cast( std::max(std::min(device_memory - min_vacancy_expected, min_spacing_expected), DEFAULT_EXPECTED_MEMORY)); diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index a27af259d..63586d9d5 100755 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp @@ -695,7 +695,7 @@ Image::Image(TextureCacheRuntime& runtime_, const VideoCommon::ImageInfo& info_, } if (IsConverted(runtime->device, info.format, info.type)) { flags |= ImageFlagBits::Converted; - flags |= ImageFlagBits::GCProtected; + flags |= ImageFlagBits::CostlyLoad; gl_internal_format = IsPixelFormatSRGB(info.format) ? GL_SRGB8_ALPHA8 : GL_RGBA8; gl_format = GL_RGBA; gl_type = GL_UNSIGNED_INT_8_8_8_8_REV; diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index a766647c7..1ad38df72 100755 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -1211,7 +1211,7 @@ Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu } else { flags |= VideoCommon::ImageFlagBits::Converted; } - flags |= VideoCommon::ImageFlagBits::GCProtected; + flags |= VideoCommon::ImageFlagBits::CostlyLoad; } if (runtime->device.HasDebuggingToolAttached()) { original_image.SetObjectNameEXT(VideoCommon::Name(*this).c_str()); diff --git a/src/video_core/texture_cache/image_base.h b/src/video_core/texture_cache/image_base.h index 279f39269..dd0106432 100755 --- a/src/video_core/texture_cache/image_base.h +++ b/src/video_core/texture_cache/image_base.h @@ -29,11 +29,11 @@ enum class ImageFlagBits : u32 { Sparse = 1 << 9, ///< Image has non continous submemory. // Garbage Collection Flags - BadOverlap = 1 << 10, ///< This image overlaps other but doesn't fit, has higher - ///< garbage collection priority - Alias = 1 << 11, ///< This image has aliases and has priority on garbage - ///< collection - GCProtected = 1 << 12, ///< Protected from low-tier GC as they are costy to load back. + BadOverlap = 1 << 10, ///< This image overlaps other but doesn't fit, has higher + ///< garbage collection priority + Alias = 1 << 11, ///< This image has aliases and has priority on garbage + ///< collection + CostlyLoad = 1 << 12, ///< Protected from low-tier GC as it is costly to load back. // Rescaler Rescaled = 1 << 13, diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 6dab8b0e7..00dcd66b7 100755 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -53,16 +53,16 @@ TextureCache

::TextureCache(Runtime& runtime_, VideoCore::RasterizerInterface& const s64 device_memory = static_cast(runtime.GetDeviceLocalMemory()); const s64 min_spacing_expected = device_memory - 1_GiB - 512_MiB; const s64 min_spacing_critical = device_memory - 1_GiB; - const s64 mem_tresshold = std::min(device_memory, TARGET_THRESHOLD); - const s64 min_vacancy_expected = (6 * mem_tresshold) / 10; - const s64 min_vacancy_critical = (3 * mem_tresshold) / 10; + const s64 mem_threshold = std::min(device_memory, TARGET_THRESHOLD); + const s64 min_vacancy_expected = (6 * mem_threshold) / 10; + const s64 min_vacancy_critical = (3 * mem_threshold) / 10; expected_memory = static_cast( std::max(std::min(device_memory - min_vacancy_expected, min_spacing_expected), DEFAULT_EXPECTED_MEMORY)); critical_memory = static_cast( std::max(std::min(device_memory - min_vacancy_critical, min_spacing_critical), DEFAULT_CRITICAL_MEMORY)); - minimum_memory = static_cast((device_memory - mem_tresshold) / 2); + minimum_memory = static_cast((device_memory - mem_threshold) / 2); } else { expected_memory = DEFAULT_EXPECTED_MEMORY + 512_MiB; critical_memory = DEFAULT_CRITICAL_MEMORY + 1_GiB; @@ -85,7 +85,8 @@ void TextureCache

::RunGarbageCollector() { auto& image = slot_images[image_id]; const bool must_download = image.IsSafeDownload() && False(image.flags & ImageFlagBits::BadOverlap); - if (!high_priority_mode && must_download) { + if (!high_priority_mode && + (must_download || True(image.flags & ImageFlagBits::CostlyLoad))) { return false; } if (must_download) {