sodium-fabric icon indicating copy to clipboard operation
sodium-fabric copied to clipboard

Entering fullscreen should not perform a video mode switch

Open jellysquid3 opened this issue 6 months ago • 3 comments

Problem

Minecraft currently uses "exclusive fullscreen", which has the consequence of sometimes needing a video mode switch when entering fullscreen. This is terrible for a lot of reasons, but the primary reason is that it causes a significant delay when switching between Minecraft and other applications on the same monitor.

Additionally, the default video mode will not match the operating system's configured refresh rate by default, so monitors which support greater than 60 Hz refresh rates will generally always suffer a mode switch penalty (by default) & have degraded performance as a result. As high-refresh monitors become ever more popular, this is a problem.

Solution

Sodium should implement support for using a "Windowed Fullscreen" mode by default. This change would ensure the user's selected video mode in Windows is preferred (including higher refresh rates), and would get rid of any mode switch delays in the default configuration.

Concerns

Regarding performance: This should not incur any performance penalty on modern systems, but we'll have to check. The biggest concern is what OpenGL drivers will do in scenarios where the game is rendered on a different GPU than the compositor which handles desktop rendering (very common for hybrid graphics on laptops.)

Assuming that isn't an issue, every mainstream operating system at this point supports fullscreen unredirection, which allows the window's surface to be directly scanned out to the display, and bypasses any overhead incurred from compositing under normal circumstances.

jellysquid3 avatar Feb 23 '24 12:02 jellysquid3