Borderless Window

Borderless Window

2M Downloads

FPS Issues with Borderless

NielsPilgaard opened this issue ยท 2 comments

commented

Description:
My FPS is about 30% lower with Borderless installed, as opposed to without. I'm just opening this issue to let you know, I'm not expecting a fix :)
The issue was discovered in this issue: EnigmaticaModpacks/Enigmatica5#280

Steps to reproduce:

  1. Start Minecraft with Borderless
  2. Make sure all terrain around you is generated, and that your FPS is set to Unlimited
  3. Note FPS
  4. Close Minecraft, remove Borderless, repeat 2) and 3)

Versions:

  • Minecraft Version: 1.15.2
  • Forge Version: 1.15.2-31.1.73
  • Mod Version: 1.15.2-1.0.1
commented

Thanks for reporting. I noticed that as well when using the borderless window, but I think FPS drop also applies to other games, as a borderless window often has slightly worse performance. But it should definitely not be that significant. On my side, I only have an FPS loss of 5-10 frames. I think there is nothing I can do to fix this problem.
The only thing that might work is to leave the window in native fullscreen, but prevent the window from minimizing when the focus is lost. The downside of this is that other windows can not be placed on top of Minecraft.
I think I will implement this behavior and let the user choose the desired fullscreen mode with a config file.

commented

I might look at making a change to GLFW that makes fullscreen windows on Windows respect the GLFW_FLOATING hint, so that disabling GLFW_AUTO_ICONIFY is more useful there, and allows putting other windows on top.

The current default method both our mods use on Windows (I maintain the Fabric equivalent Borderless Mining) seems to disable the swap interval and call DwmFlush despite the fullscreen borderless heuristics making this not necessary, which causes vsync and performance issues. See https://github.com/glfw/glfw/blob/master/src/wgl_context.c#L322 and https://github.com/glfw/glfw/blob/master/src/wgl_context.c#L349 (swapBuffersWGL and swapIntervalWGL)

Replacing the native GLFW library from a mod will be annoying, but I don't think it'd be too hard to do, and of course it can be PR'd to GLFW directly so whenever Mojang updates they can use this functionality too.