Severe frame drops in fullscreen; flawless performance in windowed

So this is a really bizarre issue that I just figured out, but can’t actually fix. I wanted to post here for visibility in case anyone else encounters this same problem and why it occurs.

I have two screens, my 144Hz monitor and my 60Hz TV connected by HDMI. When playing N64 games on Mupen64Next with GlideN64 and HLE, certain games stutter and drop in performance during certain effects/transitions. In Paper Mario for example, the game stutters every time I select a game file and the game performs a small 3D transition effect to make the files fade away. The game also stutters massively in Mystical Ninja 2 in the first level when crossing past the first major waterfall. Other N64 games stutter in specific areas in the same manner.

When playing on my PC monitor, both these issues were inconsistent. Sometimes they would occur every time, other times performance would not dip whatsoever. Sometimes it would flip-flop between the two states in the same session seconds after the other. Changing my NVIDIA power management settings for RetroArch to “Prefer Maximum Performance” fixed this issue entirely on my monitor. Now games run flawlessly on it at all times.

Unfortunately, the games still run poorly in the same manner as before when playing on my TV. I couldn’t figure out why this was, as the power profile for programs shouldn’t be reliant on which display you’re using. After extensive testing, I discovered two things:

  1. Alt-tabbing out of RetroArch (so it’s no longer in exclusive fullscreen mode) resolves these issues completely regardless of power settings and display used.
  2. When playing on my 144Hz monitor, changing the Vertical Refresh Rate from 144Hz to 60Hz causes these issues to return, even when “Prefer Maximum Performance” is left on.

I couldn’t understand why this is occurring. CPU and GPU usage in task manager didn’t show any unusual dips or spikes in activity in any of my tests. For whatever reason, having the Vertical Refresh Rate set to 144Hz for my monitor with maximum performance settings fixes the issue, but having the VRR set to 60Hz for my TV makes zero change whatsoever and also causes the issue to come back on my monitor. On top of that, playing these games with RetroArch in windowed mode instantly resolves the problem the second I alt-tab out of the program.

The only clue I have about this issue is from the emulation wiki:

Stuttering on multi-monitor setups

Further testing is needed, but on multi-monitor setups on Windows using the GL driver, it appears RetroArch will only sync smoothly when outputting to the Windows-designated primary monitor. Outputting to a secondary monitor will often result in occasional stutter, even in exclusive fullscreen and after accurate refresh rate estimation, possibly due to a WGL oversight. Short of switching primary and secondary designations prior to opening RetroArch, increasing audio latency and/or using only video sync seems to help mitigate this to an extent. Switching to either the D3D or Vulkan (if available) driver appears to eliminate this problem completely.

It seems as though the only solution I have is to run the games in windowed mode (not optimal for immersion) or physically change the cables of my GPU and displays to make Windows register my TV as the primary device (selecting it as the main display in both NVIDIA and Windows settings made zero difference whatsoever), which isn’t feasible. GLideN64 forces glcore as the graphics driver for compatibility reasons.

Sure enough, running Paper Mario 64 with Angrylion (using Vulkan, not glcore) and ParaLLEl RSP makes the game run perfectly with no graphical errors or performance drops. Running other games with these settings also results in more consistent performance, but suffers far more heavy frame drops in certain areas (probably my i7-2600K bottlenecking the LLE process, my GTX 1060 is fine).

Overall I don’t know if my problem can really be solved without upgrading my CPU, but it’s a shame that this seems to stem from some kind of OpenGL bug specific to Windows and multi-monitor setups. If anyone could shed some light on this that would be great.

i’m having the same issue but the other way around,it runs flawlessly in full screen mode but if i switch to windowed mode the frame rate drops to under 30hz,like 28/29,making it impossible to play.

it’s naturally a minor problem since i always play in full screen mode yet i’m curious to know what causes it:streets of rage works almost decently even when windowed but turrican II on PUAE and roms played on mame are just impossible to play(in window screen mode).

i played with the video options,changing drivers,messing around with sync and stuff but no improvements,and since it takes more resources to run smoothly in full screen mode,i’m even more puzzled