Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entering fullscreen should not perform a video mode switch #2359

Open
jellysquid3 opened this issue Feb 23, 2024 · 3 comments
Open

Entering fullscreen should not perform a video mode switch #2359

jellysquid3 opened this issue Feb 23, 2024 · 3 comments
Labels
T-enhancement Type: Enhancement

Comments

@jellysquid3
Copy link
Member

jellysquid3 commented Feb 23, 2024

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.

@ImBoop
Copy link

ImBoop commented May 13, 2024

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.

@jellysquid3
Copy link
Member Author

@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.)

@ImBoop
Copy link

ImBoop commented May 13, 2024

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-enhancement Type: Enhancement
Development

No branches or pull requests

2 participants