Home

Awesome

<!-- Allow this file to not have a first line heading --> <!-- markdownlint-disable-file MD041 --> <!-- inline html --> <!-- markdownlint-disable-file MD033 --> <div align="center">

🌋 ash-molten

Statically link with MoltenVK

Embark Embark Crates.io Docs dependency status Build status

</div>

ash-molten is built on top of ash and exposes a new entry point to statically link with MoltenVK.

Requires Xcode 14 and Mac OS 10.15 (Catalina) to compile.

Why?

Why not?

How?

let entry = ash_molten::MoltenEntry::load().expect("Unable to load Molten");
let app_name = CString::new("Hello Static Molten").unwrap();

let appinfo = vk::ApplicationInfo::builder()
    .application_name(&app_name)
    .application_version(0)
    .engine_name(&app_name)
    .engine_version(0)
    .api_version(vk_make_version!(1, 0, 0));

let create_info = vk::InstanceCreateInfo::builder().application_info(&appinfo);
let instance = entry.create_instance(&create_info, None).expect("Instance");
let devices = instance.enumerate_physical_devices();
println!("{:?}", devices);

You can run the example with cargo run.

How does it work?

ash-molten links statically with MoltenVK, it then uses vkGetInstanceProcAddr to resolve all the function pointers at runtime.

Features

cargo build will clone a specific release of MoltenVK compile and statically link it with your application. cargo build --features pre-built will download a pre-built version of MoltenVK from a release of ash-molten. cargo build --features external provide own MoltenVK library.

If you want to compile MoltenVK yourself, you can use the external feature. cargo build --features external requires libMoltenVK to be visible (LD_LIBRARY_PATH).

How to update

To update the version of MoltenVK uses, change the following:

Updating pre-built version

To update the prebuilt version of MoltenVK that ash-molten uses, change the following:

Contributing

Contributor Covenant

We welcome community contributions to this project.

Please read our Contributor Guide for more information on how to get started.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.