03-29-2016, 05:44 AM
Has anyone ever looked at changing the internal resolution at runtime (somewhat smoothly?) I have a crazy plan to switch between 1x and 4x in FFX when in the menu vs rest-of-game, to avoid the bad text in menu.
I started looking at the code regarding this today, concentrating on the upscaling_multiplier in GSRendererHW. Attempts so far:
1. Hooked in from GlobalCommands and added a GSApi that does setConfig("upscaling_multiplier, x). This 'works', in that I can restart the plugin and get a new upscale, but there's a jarring sound-break as the plugin resets (as well as a black screen flicker but that's not so bad. The sound is far worse). So that's not great. Basic code change was like:
ScopedCoreThreadPause paused_core(new SysExecEvent_SaveSinglePlugin(PluginId_GS));
GSsetUpscaleMultiplier(new_upscale); /* Added this API */
paused_core.AllowResume();
2. Tried just doing it in the GSRendererHW, but couldn't work out what minimal state needed to be reset to achieve the goal:
i. Just changing m_upscale_multiplier didn't work.
ii. Changing m_upscale_multiplier and calling ::Reset() worked but was slow (slower than reloading the entire plugin, it felt!).
iii. Changing m_upscale_multiplier and forcing :
etScaling() to trigger also 'worked' but led to crazy graphical glitching (when going back to 1x native resolution, the screen would zoom in on one small portion.)
It's possible #2 has promise, but I need to dig deeper into the GSRenderer* code paths to understand why simply changing m_upscale_multiplier didn't work on the next Draw() call.
I started looking at the code regarding this today, concentrating on the upscaling_multiplier in GSRendererHW. Attempts so far:
1. Hooked in from GlobalCommands and added a GSApi that does setConfig("upscaling_multiplier, x). This 'works', in that I can restart the plugin and get a new upscale, but there's a jarring sound-break as the plugin resets (as well as a black screen flicker but that's not so bad. The sound is far worse). So that's not great. Basic code change was like:
ScopedCoreThreadPause paused_core(new SysExecEvent_SaveSinglePlugin(PluginId_GS));
GSsetUpscaleMultiplier(new_upscale); /* Added this API */
paused_core.AllowResume();
2. Tried just doing it in the GSRendererHW, but couldn't work out what minimal state needed to be reset to achieve the goal:
i. Just changing m_upscale_multiplier didn't work.
ii. Changing m_upscale_multiplier and calling ::Reset() worked but was slow (slower than reloading the entire plugin, it felt!).
iii. Changing m_upscale_multiplier and forcing :

It's possible #2 has promise, but I need to dig deeper into the GSRenderer* code paths to understand why simply changing m_upscale_multiplier didn't work on the next Draw() call.