Trait Vulkan Instance Ext
Source pub trait VulkanInstanceExt: IsA<VulkanInstance> + 'static {
Show 22 methods
// Provided methods
fn check_api_version(&self, major: u32, minor: u32, patch: u32) -> bool { ... }
fn check_version(&self, major: u32, minor: u32, patch: u32) -> bool { ... }
fn create_device(&self) -> Result<VulkanDevice, Error> { ... }
fn create_device_with_index(
&self,
device_index: u32,
) -> Result<VulkanDevice, Error> { ... }
fn disable_extension(&self, name: &str) -> bool { ... }
fn enable_extension(&self, name: &str) -> bool { ... }
fn enable_layer(&self, name: &str) -> bool { ... }
fn fill_info(&self) -> Result<(), Error> { ... }
fn api_version(&self) -> (u32, u32, u32) { ... }
fn extension_info(&self, name: &str) -> Option<u32> { ... }
fn layer_info(&self, name: &str) -> Option<(Option<GString>, u32, u32)> { ... }
fn version(&self) -> (u32, u32, u32) { ... }
fn is_extension_enabled(&self, name: &str) -> bool { ... }
fn is_layer_enabled(&self, name: &str) -> bool { ... }
fn open(&self) -> Result<(), Error> { ... }
fn requested_api_major(&self) -> u32 { ... }
fn set_requested_api_major(&self, requested_api_major: u32) { ... }
fn requested_api_minor(&self) -> u32 { ... }
fn set_requested_api_minor(&self, requested_api_minor: u32) { ... }
fn connect_create_device<F: Fn(&Self, u32) -> VulkanDevice + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_requested_api_major_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_requested_api_minor_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}Expand description
Provided Methods§
Sourcefn check_api_version(&self, major: u32, minor: u32, patch: u32) -> bool
fn check_api_version(&self, major: u32, minor: u32, patch: u32) -> bool
§major
the API major version to check
§minor
the API minor version to check
§patch
the API patch version to check
§Returns
whether the VulkanInstance supports the version specified
by major, minor and patch.
Sourcefn check_version(&self, major: u32, minor: u32, patch: u32) -> bool
fn check_version(&self, major: u32, minor: u32, patch: u32) -> bool
Check if the configured vulkan instance supports the specified version.
Will not work prior to opening the instance with open().
If a specific version is requested, the patch level is ignored.
§major
major version
§minor
minor version
§patch
patch version
§Returns
whether self is at least the requested version.
Sourcefn create_device(&self) -> Result<VulkanDevice, Error>
fn create_device(&self) -> Result<VulkanDevice, Error>
§Returns
a new VulkanDevice
Sourcefn create_device_with_index(
&self,
device_index: u32,
) -> Result<VulkanDevice, Error>
fn create_device_with_index( &self, device_index: u32, ) -> Result<VulkanDevice, Error>
Sourcefn disable_extension(&self, name: &str) -> bool
fn disable_extension(&self, name: &str) -> bool
Sourcefn enable_extension(&self, name: &str) -> bool
fn enable_extension(&self, name: &str) -> bool
Enable an Vulkan extension by name. Extensions cannot be enabled until
fill_info() has been called. Enabling an extension will
only have an effect before the call to open().
§name
extension name to enable
§Returns
whether the Vulkan extension could be enabled.
Sourcefn enable_layer(&self, name: &str) -> bool
fn enable_layer(&self, name: &str) -> bool
Enable an Vulkan layer by name. Layer cannot be enabled until
fill_info() has been called. Enabling a layer will
only have an effect before the call to open().
§name
layer name to enable
§Returns
whether the Vulkan layer could be enabled.
Sourcefn fill_info(&self) -> Result<(), Error>
fn fill_info(&self) -> Result<(), Error>
Retrieve as much information about the available Vulkan instance without
actually creating an Vulkan instance. Will not do anything while self
is open.
§Returns
whether the instance information could be retrieved
Sourcefn api_version(&self) -> (u32, u32, u32)
fn api_version(&self) -> (u32, u32, u32)
Returns the vulkan API version configured when constructing the
VulkanInstance. This value can be any valid Vulkan API version and may
not match version() in any way. This version is the
maximum allowed vulkan API to be used in any capacity.
This will not return valid values until open() has been
called.
§Returns
§major
major version
§minor
minor version
§patch
patch version
Sourcefn extension_info(&self, name: &str) -> Option<u32>
fn extension_info(&self, name: &str) -> Option<u32>
Retrieves information about an extension.
Will not find any extensions before fill_info() has been
called.
§name
the layer name to look for
§Returns
whether extension name is available
§spec_version
return value for the layer specification version
Sourcefn layer_info(&self, name: &str) -> Option<(Option<GString>, u32, u32)>
fn layer_info(&self, name: &str) -> Option<(Option<GString>, u32, u32)>
Retrieves information about a layer.
Will not find any layers before fill_info() has been
called.
§name
the layer name to look for
§Returns
whether layer name is available
§description
return value for the layer description or None
§spec_version
return value for the layer specification version
§implementation_version
return value for the layer implementation version
Sourcefn version(&self) -> (u32, u32, u32)
fn version(&self) -> (u32, u32, u32)
Retrieve the vulkan instance supported version. Only returns the supported
API version by the instance without taking into account the requested API
version. This means check_version() will return
different values if a specific version has been requested (which is the
default) than a version check that is performed manually by retrieving the
version with this function.
§Returns
§major
major version
§minor
minor version
§patch
patch version
Sourcefn is_extension_enabled(&self, name: &str) -> bool
fn is_extension_enabled(&self, name: &str) -> bool
Sourcefn is_layer_enabled(&self, name: &str) -> bool
fn is_layer_enabled(&self, name: &str) -> bool
fn requested_api_major(&self) -> u32
fn set_requested_api_major(&self, requested_api_major: u32)
fn requested_api_minor(&self) -> u32
fn set_requested_api_minor(&self, requested_api_minor: u32)
Sourcefn connect_create_device<F: Fn(&Self, u32) -> VulkanDevice + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_create_device<F: Fn(&Self, u32) -> VulkanDevice + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId
Overrides the VulkanDevice creation mechanism.
It can be called from any thread.
§device_index
the index of the device
§Returns
the newly created VulkanDevice.
fn connect_requested_api_major_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_requested_api_minor_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.