MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / GSUpdateConfig

Function GSUpdateConfig

pcsx2/GS/GS.cpp:799–895  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

797}
798
799void 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 ||

Callers 1

ApplySettingsMethod · 0.85

Calls 13

GSreopenFunction · 0.85
GSClampUpscaleMultiplierFunction · 0.85
GSIsHardwareRendererFunction · 0.85
ClearCurrentMethod · 0.80
PurgePoolMethod · 0.80
UpdateRenderFixesMethod · 0.45
UpdateSettingsMethod · 0.45
ReadbackTextureCacheMethod · 0.45
PurgeTextureCacheMethod · 0.45
ClearSamplerCacheMethod · 0.45
SetGPUTimingEnabledMethod · 0.45

Tested by

no test coverage detected