Sodium

Sodium

35M Downloads

Entering fullscreen should not perform a video mode switch

jellysquid3 opened this issue ยท 3 comments

commented

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.

commented

What if the user wants a different refresh rate for the game (e.g. to maintain consistent FPS without tearing) than for Windows? Further, should at least implement a render resolution option for adjusting world render resolution independent of display resolution (and possibly even independently of the game UI) -- e.g. a user with a 4k display may want to play at 1080p or 2k resolution -- only possible with exclusive fullscreen at the moment.

commented

@ImBoop Adding the option for render scaling is discussed in #2362. For other use cases where people would want to manipulate the refresh rate, people could just continue using exclusive-mode (see the part where we'd only make borderless fullscreen the default.)

commented

@ImBoop Adding the option for render scaling is discussed in #2362. For other use cases where people would want to manipulate the refresh rate, people could just continue using exclusive-mode (see the part where we'd only make borderless fullscreen the default.)

Apologies, misread it as replace for some reason. May be worth adding resolution to the sodium UI if exclusive is enabled, then. Also shocked I couldn't find that ticket despite searching for it, thanks for the link!