Skip to content

Low FPS in windowed mode when G-Sync is enabled #1467

@vzx

Description

@vzx

I'm exploring Ebiten to play around with to create a small game. So far I have been checking out some of the examples and "following along" a little (check the example out, get some ideas, then write something similar in my own project). The project I have currently loads a PNG image and draws it, you can move it around with the arrow keys (translate x/y) and it continuously rotates (every update degrees are incremented, and the image is rotate in the draw).

What I experience however is that it is very slow in windowed mode. The TPS is at ~60, which is great, but the FPS is around ~25-40. This is both with my own project, but also with some of the examples (notable, the rotate example: https://github.com/hajimehoshi/ebiten/blob/master/examples/rotate/main.go).

My computer is relatively modern, with an Intel 6700k CPU, 8GB of RAM, and a GTX 1080 graphics card, and naturally other games run fine on it. The rotate example runs at only 640x480 in a window. My own project runs at 1920x1080 in a window too (my screen is a G-Sync 2560x1440 165Hz display).

My development environment is kind of odd, in the sense that I develop inside of WSL (Windows Subsystem for Linux) and so basically I cross-compile in Linux for Windows, and then run the Windows executable. But I would find it hard to believe that this could have any impact on the performance.

When I set it to fullscreen and the window size to 2560x1440 (my display's native resolution) it works fine however. But as you can imagine it's nicer to be able to play around and check new things out in a smaller windowed mode.

Edit: I played around with the G-Sync settings, and found out this problem occurs when:

  • G-Sync is enabled in both fullscreen and windowed mode (see picture below)
  • V-Sync is enabled in Ebiten

When G-Sync is switched to only fullscreen or disabled entirely, the problem goes away. Also if it's left enabled, but V-Sync is disabled in Ebiten, it also runs fine.

I changed the issue title accordingly.

image

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions