ash-molten
is built on top of ash and exposes a new entry point to statically link with MoltenVK.
Requires Xcode 12 and Mac OS 10.15 (Catalina) to compile.
You want to compile down to a single binary that doesn't need any environment variables to bet set.
You just want to try out MoltenVK without needing to setup the SDK.
ash already supports MoltenVK via runtime linking. Runtime linking is the preferred way of using Vulkan because the loader can be updated at anytime without needing to recompile.
ash-molten
doesn't have access to the validation layers and therefore can not output any debug information.
```Rust let entry = ashmolten::MoltenEntry::load().expect("Unable to load Molten"); let appname = CString::new("Hello Static Molten").unwrap();
let appinfo = vk::ApplicationInfo::builder() .applicationname(&appname) .applicationversion(0) .enginename(&appname) .engineversion(0) .apiversion(vkmake_version!(1, 0, 0));
let createinfo = vk::InstanceCreateInfo::builder().applicationinfo(&appinfo);
let instance = entry.createinstance(&createinfo, None).expect("Instance");
let devices = instance.enumeratephysicaldevices();
println!("{:?}", devices);
``
You can run the example with
cargo run`.
ash-molten
links statically with MoltenVK, it then uses vkGetInstanceProcAddr
to resolve all the function pointers at runtime.
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
).
To update the version of MoltenVK uses, change the following:
build.rs
, change static VERSION = "1.1.0"
to the new MoltenVK release tag nameCargo.toml
0.2.0+37
-> 0.2.1+38
.To update the prebuilt version uses, change the following:
static VERSION
.We welcome community contributions to this project.
Please read our Contributor Guide for more information on how to get started.
Licensed under either of
at your option.
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.