pub struct VulkanInstance { /* private fields */ }
Expand description

The Ash instance, entry, and additional data provided when the instance was created.

Implementations§

source§

impl VulkanInstance

source

pub unsafe fn new( required_extensions: &[String], required_layers: &[String] ) -> InstanceResult<Self>

Create a new Vulkan instance.

Params
  • required_extensions - All of the extension names required by this application. The DebugUtils extension is added automatically when compiled with debug assertions enabled.
  • required_layers - All of the layers required by this application.
Returns

The Vulkan Instance or an InstanceError if any of the extensions or layers are unavailable.

Safety

Unsafe because:

  • The Application must ensure that all device resources created with the instance are destroyed proior to dropping this struct.
source

pub fn entry(&self) -> &Entry

The raw Ash Entry.

source

pub fn ash(&self) -> &Instance

The raw Ash library instance.

source

pub fn layers(&self) -> &[String]

The layers used to create this Vulkan Instance.

source

pub fn extensions(&self) -> &[String]

The extensions used to creat this Vulkan Instance.

source

pub fn debug_utils_set_object_name( &self, logical_device: &Device, name_info: &DebugUtilsObjectNameInfoEXT )

Set the debug name for an object owned by the provided logical device.

This is a no-op for release builds.

Params
  • logical_device - the logical Vulkan device used to create the object referenced by the name info struct.
  • name_info - the name info struct containing the targeted object and its new name.

Trait Implementations§

source§

impl Debug for VulkanInstance

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for VulkanInstance

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for VulkanInstance

source§

fn drop(&mut self)

Drop the instance.

Safety

Implicitly unsafe because:

  • dropping the instance while Vulkan resources still exist can result in undefined behavior.
  • use Vulkan validation layers to verify correct resource management.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.