Bort is a vulkan wrapper on top of ash and vulkan memory allocator aiming to...
- reduce some boilerplate
- reference count resource dependencies (with
ArcorRcdepending on thercfeature flag) - call destructors with
Dropso you don't need to managedestroy_xfunctions - store create-info properties inside objects
- provide convenient defaults for create-info properties
- while also being compatible with "raw"
ash::vkstructs
This repo consists of 2 crates:
- bort-vk - vulkan wrapper. crates.io link
- bort-vma - vulkan memory allocator wrapper. crates.io link
Example: creating a descriptor set...
{
let layout_binding = DescriptorSetLayoutBinding {
binding: 0,
descriptor_type: vk::DescriptorType::UNIFORM_BUFFER,
descriptor_count: 1,
stage_flags: vk::ShaderStageFlags::FRAGMENT | vk::ShaderStageFlags::VERTEX,
..Default::default()
};
let layout_properties = DescriptorSetLayoutProperties::new_default(vec![layout_binding]);
// new_from_set_layout is a convenience function that automatically creates a pool and layout
// the pool and layout are stored inside the `descriptor_set` struct
let descriptor_set = DescriptorSet::new_from_set_layout(device, camera_layout_properties)?;
info!("descriptor pool handle: {:?}", descriptor_set.pool().handle());
info!("descriptor layout create flags: {:?}" descriptor_set.layout().properties().flags);
}
// free_descriptor_sets is called upon dropOh, also there's very little vulkan spec validity checking. I don't really care because that's what the validation layers are for imo. Shout out to vulkano, if you want enforced spec compliance, that's the place to go!
