Repository navigation
Text: a glyph atlas makes its first page's CPU copy at its first mask - #830
Merged
Merged
Conversation
Atlas::new allocated the first 2048x2048 page's CPU copy (4 MiB) up front, so a text system that only measures held it too: measure's thread-local TextSystem, on every thread that calls measure, never places a glyph. The copy is now made by Atlas::alloc when the first page takes its first mask. Every write goes through alloc; reads of an empty first page read nothing.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Atlas::newallocated the first glyph page's CPU copy (2048x2048, 4,194,304 B) up front, so a text system that only measures held it too.measure's thread-localTextSystem(text/measure.rs) never places a glyph, and an app gets one on every thread that callsmeasure. The copy is now made byAtlas::allocwhen the first page takes its first mask.allocfirst (put,reserve, the CPU boot's mask fill), so the copy exists before any write.page_datareturns an empty slice, and the CPU boot renderer reads it withget.rune-refthat writeatlas.datadirectly size it first.Measured (blade, OpenCode release, measuring build, one session open)
Related to #163: this removes the copy a measuring text system never uses. The window's own copy and the image pages' copies stay. Under Windfoil the window's copy mostly holds zeros where the GPU filled a mask, which is the next step.
Touched:
text/atlas.rs;render/metallib.rs,examples/gpu_springs.rs,examples/text_quality.rs,rune-ref/src/gpu.rssize the copy before writing into it.