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

Delay font texture update, until draw is called. Rasterize glyphs during shaping. #59862

Merged
merged 1 commit into from
Apr 6, 2022

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Apr 4, 2022

Should increase new font loading (and maybe startup times), font variation changes and rendering text with the glyph that was not used before. Instead of updating the texture when each new glyph is encountered, all glyphs updates are processed at once, and only when trying to draw.

Substantially, decreases the number of times font texture is uploaded to GPU. For Project Manager opening from 100 to 4. And from 160 to 38 when opening simple project with some extra fonts used.

@bruvzg bruvzg force-pushed the font_delay_texture_update branch from 4827301 to aad9d14 Compare April 5, 2022 07:49
@bruvzg bruvzg marked this pull request as ready for review April 6, 2022 05:37
@bruvzg bruvzg requested a review from a team as a code owner April 6, 2022 05:37
}
if (mh > texsize) { // Special case, adapt to it?
#ifdef GDEXTENSION
texsize = Math::next_power_of_2(mh);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's for a separate PR, but we could probably move the po2 methods to Math in core.

@akien-mga akien-mga merged commit 5d55846 into godotengine:master Apr 6, 2022
@akien-mga
Copy link
Member

Thanks!

@bruvzg bruvzg deleted the font_delay_texture_update branch October 19, 2022 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants