erupt-bootstrap

Crates.ioerupt-bootstrap
lib.rserupt-bootstrap
version0.3.0
sourcesrc
created_at2022-01-13 21:17:58.618536
updated_at2022-11-14 18:34:45.467059
descriptionvk-bootstrap for Rust
homepage
repositoryhttps://gitlab.com/Friz64/erupt-bootstrap
max_upload_size
id513542
size230,663
Friz64 (Friz64)

documentation

https://docs.rs/erupt-bootstrap

README

erupt-bootstrap

docs.rs crates.io

Vulkan Bootstrapping library for Rust, inspired by vk-bootstrap.

  • ✅ Instance creation
  • ✅ Physical Device selection
  • ✅ Device creation
  • ✅ Getting queues
  • ✅ Swapchain handling (courtesy of Ralith - thanks!)

MAINTENANCE MODE NOTICE

It is not recommended to use this for new projects, as erupt is in maintenance mode. There is work underway to rewrite ash using ideas from the erupt project, for updates see https://github.com/ash-rs/ash/issues/344. The functionality of erupt-bootstrap will be made available in some form or another again once this work is completed. Simple patches to erupt-bootstrap will still be merged, but no large changes are to be expected.

Cargo Features

Example

let entry = erupt::EntryLoader::new().unwrap();
let instance_builder = InstanceBuilder::new()
    .validation_layers(ValidationLayers::Request)
    .request_debug_messenger(DebugMessenger::Default)
    .require_surface_extensions(&window)
    .unwrap();
let (instance, debug_messenger, instance_metadata) =
    unsafe { instance_builder.build(&entry) }.unwrap();

let surface =
    unsafe { erupt::utils::surface::create_surface(&instance, &window, None) }.unwrap();

let graphics_present = QueueFamilyCriteria::graphics_present();
let transfer = QueueFamilyCriteria::preferably_separate_transfer();

let device_features = vk::PhysicalDeviceFeatures2Builder::new()
    .features(vk::PhysicalDeviceFeaturesBuilder::new().build());

let device_builder = DeviceBuilder::new()
    .queue_family(graphics_present)
    .queue_family(transfer)
    .require_features(&device_features)
    .for_surface(surface);
let (device, device_metadata) =
    unsafe { device_builder.build(&instance, &instance_metadata) }.unwrap();
let graphics_present = device_metadata
    .device_queue(&instance, &device, graphics_present, 0)
    .unwrap()
    .unwrap();
let transfer = device_metadata
    .device_queue(&instance, &device, transfer, 0)
    .unwrap()
    .unwrap();

For more examples, visit the git repo.

Licensing

The logo contains the Volcano Emoji of Twemoji (License). The name "erupt" was added on top of the volcano. The boot is the "Hiking Boot" from Openclipart, released into the Public Domain.

This project is licensed under the zlib License.

vk-bootstrap, the inspiration of this project, is licensed under the MIT license.

Commit count: 27

cargo fmt