pub struct Entry { /* private fields */ }Expand description
Global dispatch. Instances created here retain the native library independently.
Implementations§
Source§impl Entry
impl Entry
Sourcepub unsafe fn new() -> Result<Self, LoadError>
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.
Sourcepub unsafe fn new_from_path(path: impl AsRef<OsStr>) -> Result<Self, LoadError>
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.
Sourcepub unsafe fn new_from_resolver(
gipa: unsafe extern "system" fn(InstanceHandle, *const c_char) -> PFN_vkVoidFunction,
) -> Result<Self, LoadError>
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.
Sourcepub fn fp(&self) -> &FnEntry
pub fn fp(&self) -> &FnEntry
Borrow the immutable global dispatch table. Copied functions remain unsafe.
Sourcepub unsafe fn get_instance_proc_addr(
&self,
instance: InstanceHandle,
name: &CStr,
) -> PFN_vkVoidFunction
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.
Sourcepub unsafe fn create_instance(
&self,
create_info: &InstanceCreateInfo,
allocator: Option<&AllocationCallbacks>,
) -> Result<Instance, CallError>
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.
Source§impl Entry
impl Entry
Sourcepub fn enumerate_instance_extension_properties(
&self,
layer_name: Option<&CStr>,
) -> Result<Vec<ExtensionProperties>, CallError>
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.
Source§impl Entry
impl Entry
Sourcepub fn enumerate_instance_layer_properties(
&self,
) -> Result<Vec<LayerProperties>, CallError>
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.