| 797 | } |
| 798 | |
| 799 | void GSUpdateConfig(const Pcsx2Config::GSOptions& new_config) |
| 800 | { |
| 801 | Pcsx2Config::GSOptions old_config(std::move(GSConfig)); |
| 802 | GSConfig = new_config; |
| 803 | if (!g_gs_renderer) |
| 804 | return; |
| 805 | |
| 806 | // Handle OSD scale changes by pushing a window resize through. |
| 807 | if (new_config.OsdScale != old_config.OsdScale) |
| 808 | ImGuiManager::RequestScaleUpdate(); |
| 809 | |
| 810 | if (new_config.OsdFontPath != old_config.OsdFontPath) |
| 811 | ImGuiManager::ReloadFonts(); |
| 812 | |
| 813 | // Options which need a full teardown/recreate. |
| 814 | if (!GSConfig.RestartOptionsAreEqual(old_config)) |
| 815 | { |
| 816 | if (!GSreopen(true, true, GSConfig.Renderer, &old_config)) |
| 817 | pxFailRel("Failed to do full GS reopen"); |
| 818 | return; |
| 819 | } |
| 820 | |
| 821 | // Ensure upscale multiplier is in range. |
| 822 | GSClampUpscaleMultiplier(GSConfig); |
| 823 | |
| 824 | // Options which aren't using the global struct yet, so we need to recreate all GS objects. |
| 825 | if (GSConfig.SWExtraThreads != old_config.SWExtraThreads || |
| 826 | GSConfig.SWExtraThreadsHeight != old_config.SWExtraThreadsHeight) |
| 827 | { |
| 828 | if (!GSreopen(false, true, GSConfig.Renderer, &old_config)) |
| 829 | pxFailRel("Failed to do quick GS reopen"); |
| 830 | |
| 831 | return; |
| 832 | } |
| 833 | |
| 834 | if (GSConfig.UserHacks_DisableRenderFixes != old_config.UserHacks_DisableRenderFixes || |
| 835 | GSConfig.UpscaleMultiplier != old_config.UpscaleMultiplier || |
| 836 | GSConfig.GetSkipCountFunctionId != old_config.GetSkipCountFunctionId || |
| 837 | GSConfig.BeforeDrawFunctionId != old_config.BeforeDrawFunctionId || |
| 838 | GSConfig.MoveHandlerFunctionId != old_config.MoveHandlerFunctionId) |
| 839 | { |
| 840 | g_gs_renderer->UpdateRenderFixes(); |
| 841 | } |
| 842 | |
| 843 | // renderer-specific options (e.g. auto flush, TC offset) |
| 844 | g_gs_renderer->UpdateSettings(old_config); |
| 845 | |
| 846 | // reload texture cache when trilinear filtering or TC options change |
| 847 | if ( |
| 848 | (GSIsHardwareRenderer() && GSConfig.HWMipmap != old_config.HWMipmap) || |
| 849 | GSConfig.TexturePreloading != old_config.TexturePreloading || |
| 850 | GSConfig.TriFilter != old_config.TriFilter || |
| 851 | GSConfig.GPUPaletteConversion != old_config.GPUPaletteConversion || |
| 852 | GSConfig.PreloadFrameWithGSData != old_config.PreloadFrameWithGSData || |
| 853 | GSConfig.UserHacks_CPUFBConversion != old_config.UserHacks_CPUFBConversion || |
| 854 | GSConfig.UserHacks_DisableDepthSupport != old_config.UserHacks_DisableDepthSupport || |
| 855 | GSConfig.UserHacks_DisablePartialInvalidation != old_config.UserHacks_DisablePartialInvalidation || |
| 856 | GSConfig.UserHacks_TextureInsideRt != old_config.UserHacks_TextureInsideRt || |
no test coverage detected