From 604ade099daa06e5ee473bca03289ef55417d2ef Mon Sep 17 00:00:00 2001 From: Wunkolo Date: Thu, 3 Sep 2026 20:58:23 -0700 Subject: [PATCH] video_core: Update surface recycling criteria Recycled surfaces may only be upscaled, not downscaled. Recycled surfaces should be less than or equal to the requested resolution-scale to ensure we are only upscaling surfaces. --- src/video_core/rasterizer_cache/rasterizer_cache.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/video_core/rasterizer_cache/rasterizer_cache.h b/src/video_core/rasterizer_cache/rasterizer_cache.h index 66a418a2b..38cd87287 100644 --- a/src/video_core/rasterizer_cache/rasterizer_cache.h +++ b/src/video_core/rasterizer_cache/rasterizer_cache.h @@ -1370,6 +1370,9 @@ SurfaceId RasterizerCache::CreateSurface(const SurfaceParams& params, // Try to find a matching texture in the deletion queue const auto it = std::find_if(sentenced.begin(), sentenced.end(), [&](const auto& pair) { return (slot_surfaces[pair.first] == params) && + // Only recycle the texture if its resolution scale is equal or less than the + // incoming texture + (slot_surfaces[pair.first].res_scale <= params.res_scale) && // Only recycle the texture if the texture runtime is completely done with it (resource_free_tick > pair.second); });