iced-rs / iced

A cross-platform GUI library for Rust, inspired by Elm
https://iced.rs
MIT License
22.96k stars 1.06k forks source link

Retain caches in `iced_wgpu` as long as `Rc` values are alive #2409

Closed hecrj closed 2 weeks ago

hecrj commented 2 weeks ago

This allows reusing a canvas::Cache at no cost even if it is not presented every frame.

hecrj commented 2 weeks ago

I've created a new example that showcases how reusing caches in different frames may be useful. It is called the_matrix:

https://github.com/iced-rs/iced/assets/518289/421d6c72-96da-4b55-ba94-eb79a16e5fb0