2 unstable releases
0.2.0 | Aug 16, 2021 |
---|---|
0.1.0 | Jul 28, 2021 |
#27 in #ash
7KB
ash-direct-entry
This crate provides an EntryCustom
that directly links to libvulkan, so situations where dlopen()
-ing it is undesirable (e.g. NixOS) can be avoided.
Example
use ash::vk;
use ash_direct_entry::LibVulkan;
fn main() {
let entry = LibVulkan::entry();
let app_info = vk::ApplicationInfo {
api_version: vk::make_api_version(0, 1, 0, 0),
..Default::default()
};
let create_info = vk::InstanceCreateInfo {
p_application_info: &app_info,
..Default::default()
};
unsafe {
entry.create_instance(&create_info, None).unwrap();
}
}
lib.rs
:
This crate provides an EntryCustom
that directly links to libvulkan, so situations where
dlopen()
-ing it is undesirable (e.g. NixOS) can be avoided.
Example
use ash::vk;
use ash_direct_entry::LibVulkan;
let entry = LibVulkan::entry();
let app_info = vk::ApplicationInfo {
api_version: vk::make_api_version(0, 1, 0, 0),
..Default::default()
};
let create_info = vk::InstanceCreateInfo {
p_application_info: &app_info,
..Default::default()
};
let instance = unsafe { entry.create_instance(&create_info, None).unwrap() };
Dependencies
~5MB
~126K SLoC