Instance

Struct Instance 

Source
pub struct Instance { /* private fields */ }

Implementations§

Source§

impl Instance

Source

pub const SURFACE_EXTS_WINDOWS: [&'static CStr; 2]

Source

pub const SURFACE_EXTS_WAYLAND: [&'static CStr; 2]

Source

pub const SURFACE_EXTS_XLIB: [&'static CStr; 2]

Source

pub const SURFACE_EXTS_XCB: [&'static CStr; 2]

Source

pub const SURFACE_EXTS_ANDROID: [&'static CStr; 2]

Source

pub const SURFACE_EXTS_METAL: [&'static CStr; 2]

Source

pub fn new_with_display_extensions( entry: Arc<Entry>, max_api_version: ApiVersion, display_handle: RawDisplayHandle, layer_names: Vec<CString>, extension_names: Vec<CString>, ) -> Result<Self, InstanceError>

This function will figure out the required surface extensions based on display_handle e.g. VK_KHR_surface and platform specific ones like VK_KHR_win32_surface. Will also check if the display extensions and extension_names are supported.

Source

pub fn new( entry: Arc<Entry>, max_api_version: ApiVersion, layer_names: Vec<CString>, extension_names: Vec<CString>, ) -> Result<Self, InstanceError>

Doesn’t check for extension/layer support.

Source

pub unsafe fn new_from_create_info( entry: Arc<Entry>, create_info_builder: InstanceCreateInfoBuilder<'_>, ) -> Result<Self, InstanceError>

Source

pub fn layer_avilable(entry: &Entry, layer_name: CString) -> VkResult<bool>

Source

pub fn any_unsupported_extensions( entry: &Entry, layer_name: Option<&CStr>, extension_names: Vec<CString>, ) -> VkResult<Vec<CString>>

Returns any of the provided extension_names that are unsupported by this device.

https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkEnumerateInstanceExtensionProperties.html

Source

pub fn supports_extension( entry: &Entry, layer_name: Option<&CStr>, extension_name: CString, ) -> VkResult<bool>

Source

pub fn extension_name_is_in_properties_list( extension_properties: &Vec<ExtensionProperties>, extension_name: CString, ) -> bool

Source

pub fn physical_device_features_1_0( &self, physical_device_handle: PhysicalDevice, ) -> PhysicalDeviceFeatures

Vulkan 1.0 features

Source

pub fn physical_device_features_1_1( &self, physical_device_handle: PhysicalDevice, ) -> Option<PhysicalDeviceVulkan11Features>

Vulkan 1.1 features. If api version < 1.1, these cannot be populated.

Source

pub fn physical_device_features_1_2( &self, physical_device_handle: PhysicalDevice, ) -> Option<PhysicalDeviceVulkan12Features>

Vulkan 1.2 features. If api version < 1.2, these cannot be populated.

Source

pub fn enumerate_physical_devices(&self) -> VkResult<Vec<PhysicalDevice>>

Source

pub fn required_surface_extensions( display_handle: RawDisplayHandle, ) -> Result<&'static [&'static CStr], InstanceError>

Query the required instance extensions for creating a surface from a display handle.

This RawDisplayHandle can typically be acquired from a window, but is usually also accessible earlier through an “event loop” concept to allow querying required instance extensions and creation of a compatible Vulkan instance prior to creating a window.

The returned extensions will include all extension dependencies.

Note: this function was copied from ash to allow for better dependency control.

Source

pub fn inner(&self) -> &Instance

Access the ash::Instance struct that self contains. Allows you to access vulkan instance functions.

Source

pub fn max_api_version(&self) -> ApiVersion

Source

pub fn entry(&self) -> &Arc<Entry>

Trait Implementations§

Source§

impl Drop for Instance

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.