From 88bb26afb4262e6d679c1f87b4026f14fcbd71af Mon Sep 17 00:00:00 2001 From: Megamouse Date: Fri, 5 Nov 2021 00:02:33 +0100 Subject: [PATCH] vk: make upscaler dynamic The config option was marked as dynamic, but was never actually changed ingame --- rpcs3/Emu/RSX/VK/VKGSRender.h | 1 + rpcs3/Emu/RSX/VK/VKPresent.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.h b/rpcs3/Emu/RSX/VK/VKGSRender.h index 63a6f1dedfeb..da0d6d2296f9 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.h +++ b/rpcs3/Emu/RSX/VK/VKGSRender.h @@ -384,6 +384,7 @@ class VKGSRender : public GSRender, public ::rsx::reports::ZCULL_control std::unique_ptr m_text_writer; std::unique_ptr m_upscaler; + bool m_use_fsr_upscaling{false}; std::unique_ptr m_cond_render_buffer; u64 m_cond_render_sync_tag = 0; diff --git a/rpcs3/Emu/RSX/VK/VKPresent.cpp b/rpcs3/Emu/RSX/VK/VKPresent.cpp index 1741f0a895e9..0e33b06cb842 100644 --- a/rpcs3/Emu/RSX/VK/VKPresent.cpp +++ b/rpcs3/Emu/RSX/VK/VKPresent.cpp @@ -595,9 +595,13 @@ void VKGSRender::flip(const rsx::display_flip_info_t& info) target_layout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL; } - if (!m_upscaler) + const bool use_fsr_upscaling = g_cfg.video.vk.fsr_upscaling.get(); + + if (!m_upscaler || m_use_fsr_upscaling != use_fsr_upscaling) { - if (g_cfg.video.vk.fsr_upscaling) + m_use_fsr_upscaling = use_fsr_upscaling; + + if (m_use_fsr_upscaling) { m_upscaler = std::make_unique(); } @@ -616,7 +620,7 @@ void VKGSRender::flip(const rsx::display_flip_info_t& info) if (image_to_flip) calibration_src.push_back(image_to_flip); if (image_to_flip2) calibration_src.push_back(image_to_flip2); - if (g_cfg.video.vk.fsr_upscaling && !avconfig._3d) // 3D will be implemented later + if (m_use_fsr_upscaling && !avconfig._3d) // 3D will be implemented later { // Run upscaling pass before the rest of the output effects pipeline // This can be done with all upscalers but we already get bilinear upscaling for free if we just out the filters directly