Device

Struct Device 

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

Implementations§

Source§

impl Device

Source

pub fn new<'a>( physical_device: Arc<PhysicalDevice>, queue_create_infos: impl IntoIterator<Item = DeviceQueueCreateInfoBuilder<'a>>, features_1_0: PhysicalDeviceFeatures, features_1_1: PhysicalDeviceVulkan11Features, features_1_2: PhysicalDeviceVulkan12Features, features_1_3: PhysicalDeviceVulkan13Features, extension_names: Vec<CString>, layer_names: Vec<CString>, debug_callback_ref: Option<Arc<DebugCallback>>, ) -> Result<Self, DeviceError>

features_1_1, features_1_2 and features_1_3 might get ignored depending on the instance api version.

Source

pub unsafe fn new_with_p_next_chain<'a>( physical_device: Arc<PhysicalDevice>, queue_create_infos: &'a [DeviceQueueCreateInfo], features_1_0: PhysicalDeviceFeatures, features_1_1: PhysicalDeviceVulkan11Features, features_1_2: PhysicalDeviceVulkan12Features, features_1_3: PhysicalDeviceVulkan13Features, extension_names: Vec<CString>, layer_names: Vec<CString>, debug_callback_ref: Option<Arc<DebugCallback>>, p_next_structs: Vec<impl ExtendsDeviceCreateInfo>, ) -> Result<Self, DeviceError>

features_1_1, features_1_2 and features_1_3 might get ignored depending on the instance api version.

Note that each member of p_next_structs can only be one type (known at compile time) because the ash fn push_next currently requires the template to be Sized. Just treat it like an Option (either 0 or 1 element) and create your own p_next chain in the one element you pass to this until the next version of ash is released.

Safety: No busted pointers in the last element of p_next_structs.

Source

pub unsafe fn new_from_create_info( physical_device: Arc<PhysicalDevice>, create_info_builder: DeviceCreateInfoBuilder<'_>, debug_callback_ref: Option<Arc<DebugCallback>>, ) -> Result<Self, DeviceError>

Safety: No busted pointers in create_info_builder or its referenced structs (e.g. p_next chain).

Source

pub fn set_debug_callback_ref( &mut self, debug_callback_ref: Option<Arc<DebugCallback>>, )

Store a reference to a debug callback. The means that the debug callback won’t be dropped (and destroyed) until this device is! Handy to make sure that you still get validation while device resources are being dropped/destroyed.

Source

pub fn wait_idle(&self) -> Result<(), DeviceError>

Source

pub fn queue_wait_idle(&self, queue: &Queue) -> Result<(), DeviceError>

Source

pub fn update_descriptor_sets<'a>( &self, descriptor_writes: impl IntoIterator<Item = WriteDescriptorSetBuilder<'a>>, descriptor_copies: impl IntoIterator<Item = CopyDescriptorSetBuilder<'a>>, )

Source

pub fn wait_for_fences<'a>( &self, fences: impl IntoIterator<Item = &'a Fence>, wait_all: bool, timeout: u64, ) -> VkResult<()>

Source

pub fn inner(&self) -> &Device

Access the ash::Device struct that self contains. Allows you to access vulkan device functions.

Source

pub fn physical_device(&self) -> &Arc<PhysicalDevice>

Source

pub fn instance(&self) -> &Arc<Instance>

Source

pub fn debug_callback_ref(&self) -> &Option<Arc<DebugCallback>>

Trait Implementations§

Source§

impl Drop for Device

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Device

§

impl RefUnwindSafe for Device

§

impl Send for Device

§

impl Sync for Device

§

impl Unpin for Device

§

impl UnwindSafe for Device

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.