vulkano-rs / vulkano

Safe and rich Rust wrapper around the Vulkan API
Apache License 2.0
4.45k stars 435 forks source link

Add `Suballocator::suballocations` #2499

Closed marc0246 closed 5 months ago

marc0246 commented 5 months ago

This allows the user to display debug information about individual memory blocks internal to the allocator. MemoryAllocator isn't integrated into this yet. This unfortunately required me to change Suballocator::allocate and Suballocator::deallocate to take &mut self, which makes it a bit more inconvenient to work with in many cases. But alas, the alternative would have been to keep the internal mutability but change it to a RefCell, and I'm not a fan of internal synchronization if it can be helped. It just means that the user will have to put the RefCell externally if needed.

Changelog:

### Breaking changes
Changes to memory allocation:
- `Suballocator::{allocate,deallocate}` now take `&mut self`.
- `Suballocator` has new required items `Suballocations` and `suballocations` for iterating over suballocations.