not-coded / WayFix

Fixes multiple issues regarding Wayland compatibility for Minecraft.
https://modrinth.com/mod/wayfix
GNU Lesser General Public License v2.1
5 stars 0 forks source link

Sodium Extras adaptive vsync support #2

Closed Titaniumtown closed 1 month ago

Titaniumtown commented 1 month ago

When this mod is installed, the "adaptive" option for vsync on sodium extras is absent. I have a freesync display and am unable to use this mod and also have adaptive sync.

W/o wayfix: image

w/ wayfix: image

not-coded commented 1 month ago

The adaptive option for VSync is from Sodium Extras, not Sodium. https://github.com/FlashyReese/sodium-extra-fabric/blob/1.21/dev/common/src/main/java/me/flashyreese/mods/sodiumextra/mixin/sodium/vsync/MixinSodiumGameOptionsPages.java#L47

The reason why Adaptive VSync isn't there, is because Wayland GLFW doesn't support GLX_EXT_swap_control_tear and WGL_EXT_swap_control_tear whilst X11/XWayland supports GLX_EXT_swap_control_tear and WGL_EXT_swap_control_tear (nvidia only). https://github.com/FlashyReese/sodium-extra-fabric/blob/1.21/dev/common/src/main/java/me/flashyreese/mods/sodiumextra/mixin/adaptive_sync/MixinWindow.java#L18

Forcing Sodium Extras to use Adaptive Sync logs that exact message in the console: image image

In my own testing: image

Wayland: image

X11/XWayland: image WGL_EXT_swap_control_tear is not supported because I don't have an NVIDIA GPU

Titaniumtown commented 1 month ago

Oh thanks for the correction! Interesting find. So it's an upstream GLFW issue then. Thanks!