Ashpan

Crates.io Version Documentation License: MIT License: Apache 2.0

RAII helpers for ash

ashpan makes it easier to properly clean up ash resources when failures occur. It's essentially a scopeguard that has been tailored to Vulkan.

Example

```rust use ashpan::{DeviceExt, Guarded};

struct Resources { ... }

unsafe fn createresources(device: &ash::Device) -> VkResult { let renderpass = createrenderpass(device)?; let pipelinelayout = createpipelinelayout(device)?; let pipeline = createpipeline(device, *renderpass, *pipelinelayout)?; Ok(Resources { renderpass: renderpass.take(), pipelinelayout: pipelinelayout.take(), pipeline: pipeline.take(), }) }

unsafe fn createrenderpass(device: &ash::Device) -> VkResult> { let createinfo = unimplemented!(); device.createguardedrenderpass(create_info, None) } ```

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.