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

Resizing a floating game window is slow #102197

Open
alanmelloni97 opened this issue Jan 30, 2025 · 3 comments
Open

Resizing a floating game window is slow #102197

alanmelloni97 opened this issue Jan 30, 2025 · 3 comments

Comments

@alanmelloni97
Copy link

alanmelloni97 commented Jan 30, 2025

Tested versions

  • Reproducible in 4.4 Beta2 and 4.4 Beta1
  • While in 4.3stable it is somewhat slow, it got considerably worse on 4.4 Beta1

System information

Godot v4.4.beta1 - Windows 10 (build 19045) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1050 (NVIDIA; 31.0.15.5212) - Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz (4 threads)

Issue description

When trying to resize the floating game window, the movement is not smooth and appears as low FPS

2025-01-30-14-08-31.mp4

(video is from beta1 but also reproducible on beta2)

Steps to reproduce

Create new project with empty Node2D scene and hit play, then resize game window

Minimal reproduction project (MRP)

N/A

@Chaosus
Copy link
Member

Chaosus commented Jan 30, 2025

cc @Hilderin

@Calinou
Copy link
Member

Calinou commented Jan 30, 2025

Resizing a window will always be a slow operation with Vulkan as recreating the swapchain takes a while (definitely longer than OpenGL). Since game window embedding is used, Godot has to resize two swapchains every time the window is resized: one for the floating window, and one for the game being embedded (which is a second floating window).

Unfortunately, I don't see a way to optimize this, as a lot of the slowness is down to the OS and graphics driver here. If you switch to the Compatibility rendering method, it should appear to be noticeably faster.

We can however make the slowness less appearant by not requiring the game window to have its resize operation completed before you can see changes to the floating window. This means they will visibly go out of sync during resize operations, but it may be preferable to do this if it means it's smoother to resize the window.

@Calinou Calinou changed the title [4.4 Beta2] Resizing floating game window is lagged Resizing a floating game window is slow Jan 30, 2025
@Ivorforce
Copy link
Contributor

Resizing a window will always be a slow operation with Vulkan

That may as well be true, but I'd profile the resize before making a final judgement! It's always possible there's something else unexpected going on that's eating resources.
I'd do this myself but unfortunately there's no embedding available for my system yet!

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