vulkano-rs / vulkano

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

Use Ash builders for Vulkan struct construction + refactor #2525

Open Rua opened 4 months ago

Rua commented 4 months ago

The Ash builder methods are now used instead of raw pointers, so that lifetimes are correctly tracked. This did, however, need some significant refactoring because of how borrowing rules work. For that reason, I moved all Ash struct construction into the structs themselves (as methods). The methods and structs follow a tiered logic where each value borrows from those below it:

Mutable borrows are needed for the extension structs because push_next takes a mutable reference.

The DeviceFeatures and DeviceProperties construction have been left out of this, those need more attention that will be done in a separate PR.