Crate vk_profiles_rs
source · [−]Expand description
Vulkan Profiles Library
https://github.com/KhronosGroup/Vulkan-Profiles
Examples
use ash::vk;
use vk_profiles_rs::vp;
// Load the function pointers
let vk_profiles = vk_profiles_rs::VulkanProfiles::linked();
// Select the lunarg desktop portability 2021 profile and test instance support
let profile = vp::LunargDesktopPortability2021::profile_properties();
assert!(unsafe { vk_profiles.get_instance_profile_support(None, &profile)? });
let instance_info = vk::InstanceCreateInfo::builder();
let vp_instance_info = vp::InstanceCreateInfo::builder()
.create_info(&instance_info)
.profile(&profile);
let entry = ash::Entry::linked();
// The created instance is a standard [ash::Instance]
let instance = unsafe { vk_profiles.create_instance(&entry, &vp_instance_info, None)? };
Ash design patterns
This crate uses ash design patterns wherever possible to allow for seamless usage. Structs have builder versions, enums use the same constructs etc.
Important notes
Currently only static linking is supported. This means that the vulkan loader must also be statically linked in ash.
Modules
The vulkan profiles structures and function definitions.
Structs
A wrapper struct that provides access to the vulkan profiles functions.