| Crates.io | vinit |
| lib.rs | vinit |
| version | 0.5.0 |
| created_at | 2025-12-14 22:11:26.396655+00 |
| updated_at | 2025-12-21 19:59:43.566394+00 |
| description | Zero-cost, type-safe Vulkan initialization with compile-time guarantees |
| homepage | https://github.com/Fasamii/vinit |
| repository | https://github.com/Fasamii/vinit |
| max_upload_size | |
| id | 1985185 |
| size | 177,703 |
Zero-runtime-cost Vulkan initialization with compile-time guarantees.
vinit is a strongly typed Vulkan initialization library built on top of
ash.
It uses type-state, generic constraints, and compile-time dependency
validation to ensure that Vulkan objects are created in a correct
manner before program even runs. Which means that:
Are simply impossible.
Device without an InstanceInstance, Device, command pools)vinit uses type-state programming to track which components are present.
At every step:
The type system enforces:
Which means that code like this
let base = BaseConfig::default()
.with(device::Device::default());
Wont even compile because device requires Instance to be present.
use vinit::*;
use std::ffi::CString;
let base = BaseConfig::default()
.with(
instance::Instance::default()
.app_name(CString::new("My App").unwrap())
.validation(vec![
CString::new("VK_LAYER_KHRONOS_validation").unwrap(),
]),
)
.with(
device::Device::default()
.require_features(
vk::PhysicalDeviceFeatures::default()
.alpha_to_one(true)
.occlusion_query_precise(true),
)
.require_properties(
vk::PhysicalDeviceProperties::default().limits(
vk::PhysicalDeviceLimits::default()
.max_fragment_combined_output_resources(1235),
),
),
)
.with(command::CommandPool::graphics())
.with(command::CommandPool::compute().flags(vk::CommandPoolCreateFlags::empty()))
.build();