Closed JMS55 closed 6 months ago
I am going to experiment with making a dumb bind group cache at some point fairly soon to support some of the rendering optimisation, but I am intending to use generational indices, free lists, atomics, etc. I’m also not yet concerned about LRU/LFU, and I’m not sure how we want to manage assets. I think the texture cache has a simple ‘if not used for N frames then drop’ policy.
A quick search shows that there's still no BufferCache
in Bevy, but this issue was marked as completed. What did we implement?
We didn't end up implementing anything. Caching is done ad-hoc for each rendering feature.
What problem does this solve or what need does it fill?
Currently we have only a TextureCache and PipelineCache. We'd additionally want at least BufferCache. Maybe a SamplerCache and BindGroupCache.
It would also be great to have a generic cache type. Something that acts like a HashMap and evicts no longer used resources, which we can reuse for other rendering tasks instead of implementing it from scratch every time. I've found use cases for BLAS storage, FSR/DLSS contexts, and other times I want to cache custom render resources.
What solution would you like?
Adopt moka, or a similar crate.
What alternative(s) have you considered?
Write a generic caching API ourselves.