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

VSync Mailbox causes 100% GPU usage #89856

Open
Anixias opened this issue Mar 24, 2024 · 2 comments
Open

VSync Mailbox causes 100% GPU usage #89856

Anixias opened this issue Mar 24, 2024 · 2 comments

Comments

@Anixias
Copy link

Anixias commented Mar 24, 2024

Tested versions

v4.3.dev5.mono.official [89f70e9]

System information

Windows 11 - Vulkan and DirectX 12 - Forward+ and Mobile

Issue description

The project was having extremely horrible jitter of frames (constantly switching back to old frames randomly, causing disorienting blur and horrible artifacts), so I tried every VSync mode. Mailbox completely fixed the issue I was facing, but instead of using less than 15% of my GPU on other modes, Mailbox mode instantly forces my GPU to 100% regardless of rendering complexity. It will remain at 100% (never dipping lower) until the game is closed.

Note that my horrible rendering issue only appears in Forward+ and Mobile. Vsync Enabled in Compatibility does not have the issue I was facing.

Steps to reproduce

  1. Use VSync Mailbox mode in Forward+ or Mobile rendering mode
  2. Presumably render something. In my case, I have a simple grid of lines rendering in 2d.
  3. Open Task Manager and view the Performance tab

Minimal reproduction project (MRP)

N/A

@mrjustaguy
Copy link
Contributor

mrjustaguy commented Mar 24, 2024

This is expected, as it's rendering as many frames as the CPU can possibly send to it, and Mailbox only works on forward and mobile renderers - https://docs.godotengine.org/en/stable/classes/class_displayserver.html

VSyncMode >VSYNC_MAILBOX = 3
Displays the most recent image in the queue on vertical blanking intervals, while rendering to the other images (no tearing is >visible). Framerate is unlimited (notwithstanding Engine.max_fps).
Although not guaranteed, the images can be rendered as fast as possible, which may reduce input lag (also called "Fast" V-Sync mode). VSYNC_MAILBOX works best when at least twice as many frames as the display refresh rate are rendered. Behaves like VSYNC_ENABLED when using the Compatibility rendering method.

The issue you are having with other modes is a known issue however - #84137

This is also why mailbox is resolving it, as it's brute forcing the issue away by rendering many more frames, ensuring that the frame that gets displayed is newer then the last one displayed.

@Calinou
Copy link
Member

Calinou commented Mar 29, 2024

I'm surprised Mailbox V-Sync results in much higher GPU utilization than Disabled V-Sync though, as both are pretty much rendering the same framerate in most situations.

Unfortunately, not many Vulkan games expose mailbox V-Sync to the user so you could check this in applications other than Godot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants