vulkano_maybe_molten

Crates.iovulkano_maybe_molten
lib.rsvulkano_maybe_molten
version0.30.1
sourcesrc
created_at2022-10-09 00:28:52.363659
updated_at2022-11-08 15:44:59.183287
descriptionUse vulkano-rs with ash-molten on macOS and without on other platforms
homepage
repositoryhttps://github.com/apertus-open-source-cinema/vulkano-maybe-molten/
max_upload_size
id683803
size19,246
(anuejn)

documentation

README

vulkano_maybe_molten

Use vulkano-rs with ash-molten on macOS and without on other platforms.

This small crate allows you to use vulkano-rs on macOS without needing to install the vulkan SDK by combining it with ash-molten. On non-apple platforms the vulkano-builtin ash is used.

Usage

use vulkano::device::physical::PhysicalDevice;
use vulkano::instance::{Instance, InstanceCreateInfo, InstanceCreationError};
use vulkano_maybe_molten::NewMaybeMolten;

fn main() -> Result<(), InstanceCreationError> {
    // the only thing we do differently here is to use new_maybe_molten() instead of new()
    let instance = Instance::new_maybe_molten(InstanceCreateInfo::default())?;

    let devices: Vec<_> = PhysicalDevice::enumerate(&instance)
        .map(|device| device.properties().device_name.clone())
        .collect();
    println!("Found GPUs: {:?}", devices);

    Ok(())
}
Commit count: 5

cargo fmt