7 releases

0.3.1 Jul 13, 2022
0.3.0 Jul 10, 2022
0.2.1 Jun 3, 2022
0.2.0 Apr 13, 2022
0.1.2 Apr 13, 2022

#507 in Graphics APIs

MIT/Apache

42KB
887 lines

VkProfiles RS

Rust bindings for the Vulkan Profiles library using Ash. The crate is designed as close as possible to Ash to allow for easy usage.

Note: The vulkan loader must be statically linked in ash

Additional dependencies

These are required to build the vulkan profiles library

  • A C++ compiler
  • CMake
  • Vulkan SDK. Only the vulkan headers are required for the build.

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.


lib.rs:

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.

Dependencies

~5.5MB
~133K SLoC