Struct vulkano::library::VulkanLibrary
source · [−]pub struct VulkanLibrary { /* private fields */ }
Expand description
A loaded library containing a valid Vulkan implementation.
Implementations
sourceimpl VulkanLibrary
impl VulkanLibrary
sourcepub fn new() -> Result<Arc<Self>, LoadingError>
pub fn new() -> Result<Arc<Self>, LoadingError>
Loads the default Vulkan library for this system.
sourcepub fn with_loader<L>(loader: L) -> Result<Arc<Self>, LoadingError>where
L: Loader + 'static,
pub fn with_loader<L>(loader: L) -> Result<Arc<Self>, LoadingError>where
L: Loader + 'static,
Loads a custom Vulkan library.
sourcepub fn fns(&self) -> &EntryFunctions
pub fn fns(&self) -> &EntryFunctions
Returns pointers to the raw global Vulkan functions of the library.
sourcepub fn api_version(&self) -> Version
pub fn api_version(&self) -> Version
Returns the highest Vulkan version that is supported for instances.
sourcepub fn supported_extensions(&self) -> &InstanceExtensions
pub fn supported_extensions(&self) -> &InstanceExtensions
Returns the extensions that are supported by this Vulkan library.
sourcepub fn layer_properties(
&self
) -> Result<impl ExactSizeIterator<Item = LayerProperties>, OomError>
pub fn layer_properties(
&self
) -> Result<impl ExactSizeIterator<Item = LayerProperties>, OomError>
Returns the list of layers that are available when creating an instance.
On success, this function returns an iterator that produces
LayerProperties
objects. In order to enable a layer,
you need to pass its name (returned by LayerProperties::name()
) when creating the
Instance
.
Note: The available layers may change between successive calls to this function, so each call may return different results. It is possible that one of the layers enumerated here is no longer available when you create the
Instance
. This will lead to an error when callingInstance::new
.
Example
use vulkano::VulkanLibrary;
let library = VulkanLibrary::new().unwrap();
for layer in library.layer_properties().unwrap() {
println!("Available layer: {}", layer.name());
}
sourcepub unsafe fn get_instance_proc_addr(
&self,
instance: Instance,
name: *const c_char
) -> PFN_vkVoidFunction
pub unsafe fn get_instance_proc_addr(
&self,
instance: Instance,
name: *const c_char
) -> PFN_vkVoidFunction
Calls get_instance_proc_addr
on the underlying loader.