Skip to content

Conversation

@edwloef
Copy link
Contributor

@edwloef edwloef commented Oct 4, 2025

I have large meshes that I'd like to not have to recreate/clone every time I draw them. When using wgpu I can use a iced_wgpu::geometry::Cache, however a renderer-agnostic way to cache these would be nice, even if the tiny-skia renderer doesn't support meshes.

@edwloef
Copy link
Contributor Author

edwloef commented Oct 4, 2025

Failing CI is from an upstream rustdoc change: rust-lang/rust#138907

@mahlquistj
Copy link

This is great. We have ~25% performance increase by reusing the meshes! Hoping this gets merged soon! 👍

@hecrj hecrj changed the title make Meshes cheaply cloneable by using Arc<[T]> in iced_graphics::mesh::Indexed Introduce draw_mesh_cache in mesh::Renderer Nov 29, 2025
@hecrj hecrj added this to the 0.14 milestone Nov 29, 2025
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

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

Thanks!

I have moved the Cache in wgpu to mesh which lets renderers reuse buffers under the hood.

This also avoids redundant Arc when caching isn't desired.

@hecrj hecrj enabled auto-merge November 29, 2025 16:38
@hecrj hecrj merged commit b9eeb34 into iced-rs:master Nov 29, 2025
15 checks passed
@edwloef edwloef deleted the cheap_mesh_clone branch November 30, 2025 09:53
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.

3 participants