From cc5a88a86438668874063f44e2e30f499c415ffd Mon Sep 17 00:00:00 2001 From: GPUCode <47210458+GPUCode@users.noreply.github.com> Date: Sun, 21 Aug 2022 22:24:26 +0300 Subject: [PATCH] rasterizer_cache: Make cache reset on resolution/filter change more explicit --- src/video_core/rasterizer_cache/rasterizer_cache.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/video_core/rasterizer_cache/rasterizer_cache.cpp b/src/video_core/rasterizer_cache/rasterizer_cache.cpp index d2ae5aef9..f9eb4be63 100644 --- a/src/video_core/rasterizer_cache/rasterizer_cache.cpp +++ b/src/video_core/rasterizer_cache/rasterizer_cache.cpp @@ -584,10 +584,12 @@ SurfaceSurfaceRect_Tuple RasterizerCacheOpenGL::GetFramebufferSurfaces( const auto& regs = Pica::g_state.regs; const auto& config = regs.framebuffer.framebuffer; - // update resolution_scale_factor and reset cache if changed - if ((resolution_scale_factor != VideoCore::GetResolutionScaleFactor()) || - (VideoCore::g_texture_filter_update_requested.exchange(false) && - texture_filterer->Reset(Settings::values.texture_filter_name, resolution_scale_factor))) { + // Update resolution_scale_factor and reset cache if changed + const bool resolution_scale_changed = resolution_scale_factor != VideoCore::GetResolutionScaleFactor(); + const bool texture_filter_changed = VideoCore::g_texture_filter_update_requested.exchange(false) + && texture_filterer->Reset(Settings::values.texture_filter_name, VideoCore::GetResolutionScaleFactor()); + + if (resolution_scale_changed || texture_filter_changed) { resolution_scale_factor = VideoCore::GetResolutionScaleFactor(); FlushAll(); while (!surface_cache.empty())