Skip to content

vello_cpu: Support custom atlas size#1658

Draft
fundon wants to merge 4 commits into
linebender:mainfrom
fundon:vello_cpu_supports_custom_atlas_size
Draft

vello_cpu: Support custom atlas size#1658
fundon wants to merge 4 commits into
linebender:mainfrom
fundon:vello_cpu_supports_custom_atlas_size

Conversation

@fundon
Copy link
Copy Markdown

@fundon fundon commented May 18, 2026

Currently, the atlas size is not customizable and DEFAULT_GLYPH_ATLAS_SIZE can cause excessive memory usage.

And expose Resources::before_render Resources::after_render methods, so this part of code can be simplified.

The behavior of vello_cpu Resources and vello_hybrid Resources will be more consistent.

@fundon fundon force-pushed the vello_cpu_supports_custom_atlas_size branch 2 times, most recently from 324bc59 to 0820789 Compare May 18, 2026 20:19
@LaurenzV
Copy link
Copy Markdown
Collaborator

I can get behind configuring the atlas size, but not why you want to expose before_render/after_render? This is supposed to be abstracted away from the user.

@LaurenzV
Copy link
Copy Markdown
Collaborator

LaurenzV commented May 18, 2026

Oh, I see now this is in parley… I believe this is still using an older version of vello CPU, so the code hasn’t been updated yet. It should be possible to remove all of this.

@fundon
Copy link
Copy Markdown
Author

fundon commented May 18, 2026

Another scenario is that after rendering, we can pass atlas.get(glyph_key), and then we can upload the atlas to our custom GPU texture.

@fundon fundon force-pushed the vello_cpu_supports_custom_atlas_size branch 2 times, most recently from dd48b07 to 384f82f Compare May 19, 2026 07:29
@fundon
Copy link
Copy Markdown
Author

fundon commented May 19, 2026

It should be possible to remove all of this.

I hope there is a more concise way. After rendering, cache it into GlyphAtlas, and subsequent users can easily obtain data from GlyphAtlas::get.

@fundon fundon force-pushed the vello_cpu_supports_custom_atlas_size branch 2 times, most recently from 67bc973 to e9bd487 Compare May 19, 2026 09:00
Copy link
Copy Markdown
Collaborator

@LaurenzV LaurenzV left a comment

Choose a reason for hiding this comment

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

LGTM overall.

Comment thread sparse_strips/vello_cpu/src/render.rs Outdated
@LaurenzV
Copy link
Copy Markdown
Collaborator

By the way, I do want to warn you that the atlas caching API is still experimental and not meant for production use yet. While it seems to work, there are still a number of issues to resolve, especially around performance when zooming.

@fundon fundon force-pushed the vello_cpu_supports_custom_atlas_size branch from e9bd487 to aa109c3 Compare May 19, 2026 18:40
@fundon
Copy link
Copy Markdown
Author

fundon commented May 19, 2026

By the way, I do want to warn you that the atlas caching API is still experimental and not meant for production use yet. While it seems to work, there are still a number of issues to resolve, especially around performance when zooming.

Ok. I'll give feedback if there are any problems. Thanks.

@LaurenzV LaurenzV self-requested a review May 21, 2026 07:51
@fundon fundon marked this pull request as draft May 21, 2026 16:55
@fundon fundon force-pushed the vello_cpu_supports_custom_atlas_size branch from 087ab29 to 6aef176 Compare May 22, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants