Realm

vk::load · Structs · E1

Global dispatch. Instances created here retain the native library independently.

StRustExperimental

Stvk::load::Entry

Contract

Global dispatch. Instances created here retain the native library independently.

Methods and associated items

new

Method
pub unsafe fn new() -> Result<Self, LoadError>

Load the platform’s default Vulkan library.

Safety

The library and its initialization routines must be safe to load, and it must implement the Vulkan ABI. Raw copied PFNs must not outlive all owners.

new_from_path

Method
pub unsafe fn new_from_path(path: impl AsRef<OsStr>) -> Result<Self, LoadError>

Load a Vulkan implementation at the supplied native path.

Safety

The library’s initialization/finalization must be safe, and its exports must implement Vulkan. Raw copied PFNs must not outlive all library owners.

new_from_resolver

Method
pub unsafe fn new_from_resolver( gipa: unsafe extern "system" fn(InstanceHandle, *const c_char) -> PFN_vkVoidFunction, ) -> Result<Self, LoadError>

Construct dispatch using an externally owned resolver.

Safety

The resolver must implement Vulkan and remain callable for this entry and all instances and raw PFNs derived from it, including any entry clones.

fp

Method
pub fn fp(&self) -> &FnEntry

Borrow the immutable global dispatch table. Copied functions remain unsafe.

get_instance_proc_addr

Method
pub unsafe fn get_instance_proc_addr( &self, instance: InstanceHandle, name: &CStr, ) -> PFN_vkVoidFunction

Resolve a command for a live instance, or a global command with NULL.

Safety

instance must be NULL or a live instance from this implementation. The caller must retain the library while using the returned function.

Khronos reference: vkGetInstanceProcAddr

create_instance

Method
pub unsafe fn create_instance( &self, create_info: &InstanceCreateInfo<'_>, allocator: Option<&AllocationCallbacks>, ) -> Result<Instance, CallError>

Create a headless or extension-configured Vulkan instance.

Safety

The create info, its reachable pointers and allocator callbacks must meet Vulkan valid usage. Allocator state must remain alive until destruction.

Khronos reference: vkCreateInstance

enumerate_instance_extension_properties

Method
pub fn enumerate_instance_extension_properties( &self, layer_name: Option<&CStr>, ) -> Result<Vec<ExtensionProperties>, CallError>

Enumerate instance extensions available without any layer.

Pass layer_name = None for the implicit layer (ICD + loader). Pass a layer name to query extensions exposed by that specific layer.

Errors

Returns CallError::MissingCommand if the driver predates Vulkan 1.0 (practically impossible) or CallError::Vulkan on a driver failure.

Khronos reference: vkEnumerateInstanceExtensionProperties

enumerate_instance_layer_properties

Method
pub fn enumerate_instance_layer_properties( &self, ) -> Result<Vec<LayerProperties>, CallError>

Enumerate all implicit and explicit Vulkan layers installed on this system.

Errors

Returns CallError::MissingCommand if the command is absent or CallError::Vulkan on a driver failure.

Khronos reference: vkEnumerateInstanceLayerProperties