-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
UI scaling example crashes #6466
Comments
Broken by #5708, ping @xtr3m3nerd :) |
So this here is an example of what would have caused a memory leak before, which is what the error introduced in my change is intending to protect against. This is happening because the scale_factor in pipeline.queue_text (which is what the UiScale resource modifies) will modify the the font_size, ultimately growing the FontAtlasSet. In this example the scale is being modified dynamically on a frame by frame basis, which I cant imaging is a typical usecase for UiScale, which I see as primarily being used for setting up UI based on screen and game settings. Now considering this usecase and wanting to demonstrate dynamically changing the UI the example can easily be fixed by adding:
to the example. In this situation the panic error text in the #5708 fix seems confusing. I was thinking that we should modify it to also mention that dynamically modifying the scale could also be the cause of the issue. |
Great analysis. I think we should improve the error message, and fix the example by configuring that resource. |
# Objective Fixes: bevyengine#6466 Summary: The UI Scaling example dynamically scales the UI which will dynamically allocate fonts to the font atlas surpassing the protective limit, throwing a panic. ## Solution - Set TextSettings.allow_dynamic_font_size = true for the UI Scaling example. This is the ideal solution since the dynamic changes to the UI are not continuous yet still discrete. - Update the panic text to reflect ui scaling as a potential cause
Bevy version
3a14ae4
What you did
cargo run --example ui_scaling
Pressing down first and up second also crashes
What went wrong
The text was updated successfully, but these errors were encountered: