Vulkan Bootstrapping library for Rust, inspired by [vk-bootstrap
].
surface
(enabled by default): Enables the use of [raw-window-handle
].```rust let entry = EntryLoader::new().unwrap(); let instancebuilder = InstanceBuilder::new() .validationlayers(ValidationLayers::Request) .requestdebugmessenger(DebugMessenger::Default) .requiresurfaceextensions(&window) .unwrap(); let (instance, debugmessenger, instancemetadata) = unsafe { instance_builder.build(&entry) }.unwrap();
let surface = unsafe { erupt::utils::surface::create_surface(&instance, &window, None) }.unwrap();
let graphicspresent = QueueFamilyCriteria::graphicspresent(); let transfer = QueueFamilyCriteria::preferablyseparatetransfer();
let device_features = vk::PhysicalDeviceFeatures2Builder::new() .features(vk::PhysicalDeviceFeaturesBuilder::new().build());
let devicebuilder = DeviceBuilder::new() .queuefamily(graphicspresent) .queuefamily(transfer) .requirefeatures(&devicefeatures) .forsurface(surface); let (device, devicemetadata) = unsafe { devicebuilder.build(&instance, &instancemetadata) }.unwrap(); let graphicspresent = devicemetadata .devicequeue(&instance, &device, graphicspresent, 0) .unwrap() .unwrap(); let transfer = devicemetadata .devicequeue(&instance, &device, transfer, 0) .unwrap() .unwrap(); ```
For more examples, visit the git repo.
This project is licensed under the [zlib License].
vk-bootstrap
, the inspiration of this project, is licensed under the [MIT license].