You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reproducible in 4.1.2 stable, 4.2.1 stable, 4.2.2 stable
System information
M1 Mac Mini, macOS Ventura/Sonoma, Forward and Mobile renderer
Issue description
After porting our game from 3.5 to 4.1.2, I noticed the editor hanging for a long time (spinning beach ball on Mac) when switching back to Godot from other apps/desktops, often for so long I just have to force quit Godot. I found that it's triggered by any tool script drawing anything in _draw(), and also by certain built in nodes that draw extra things in the viewport, such as Path2D. The problem scales with both the amount of things drawn as well as the time Godot is offscreen. This also causes Godot to accumulate memory use while offscreen (some of which seems to be reclaimed after the stall finishes).
The problem only occurs while the editor is not visible at all on the desktop, i.e. fully hidden by other windows, minimized, on another desktop, etc. Also it only happens when using queue_redraw() repeatedly, just drawing once doesn't do it. Applies to both Vulkan renderers, compatibility seems okay.
Somewhat similar to #64708 and #82769, but reproduced in 4.2 beta 3, so #83096 did not fix this.
Steps to reproduce
Open (don't run) the MRP scene in editor. Minimize Godot for a minute or two, open Godot, it should be frozen for some time before becoming responsive again.
djrain
changed the title
Custom drawing in tool script causes editor hang and memory leak
Drawing anything while Godot is offscreen freezes editor and leaks memory
Jun 26, 2024
I suspect this is an issue with obtaining the nextDrawable, which will block until the window is no longer occluded, unless the allowsNextDrawableTimeout property is true. Even with a timeout, it will still block for 1 second, which could be a cause the hanging you are talking about.
This would require Godot's render loop skips presentation, if the window is fully occluded. Fortunately, this is also fairly easy to check by querying the window's occlusionState
Godot version
reproducible in 4.1.2 stable, 4.2.1 stable, 4.2.2 stable
System information
M1 Mac Mini, macOS Ventura/Sonoma, Forward and Mobile renderer
Issue description
After porting our game from 3.5 to 4.1.2, I noticed the editor hanging for a long time (spinning beach ball on Mac) when switching back to Godot from other apps/desktops, often for so long I just have to force quit Godot. I found that it's triggered by any tool script drawing anything in _draw(), and also by certain built in nodes that draw extra things in the viewport, such as Path2D. The problem scales with both the amount of things drawn as well as the time Godot is offscreen. This also causes Godot to accumulate memory use while offscreen (some of which seems to be reclaimed after the stall finishes).
The problem only occurs while the editor is not visible at all on the desktop, i.e. fully hidden by other windows, minimized, on another desktop, etc. Also it only happens when using queue_redraw() repeatedly, just drawing once doesn't do it. Applies to both Vulkan renderers, compatibility seems okay.
Somewhat similar to #64708 and #82769, but reproduced in 4.2 beta 3, so #83096 did not fix this.
Steps to reproduce
Open (don't run) the MRP scene in editor. Minimize Godot for a minute or two, open Godot, it should be frozen for some time before becoming responsive again.
May only apply on macOS
Minimal reproduction project
QueueRedrawBug.zip
The text was updated successfully, but these errors were encountered: