pub struct Device { /* private fields */ }Implementations§
Source§impl Device
impl Device
Sourcepub 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>
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.
Sourcepub 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>
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.
Sourcepub unsafe fn new_from_create_info(
physical_device: Arc<PhysicalDevice>,
create_info_builder: DeviceCreateInfoBuilder<'_>,
debug_callback_ref: Option<Arc<DebugCallback>>,
) -> Result<Self, DeviceError>
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).
Sourcepub fn set_debug_callback_ref(
&mut self,
debug_callback_ref: Option<Arc<DebugCallback>>,
)
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.
Sourcepub fn wait_idle(&self) -> Result<(), DeviceError>
pub fn wait_idle(&self) -> Result<(), DeviceError>
Sourcepub fn queue_wait_idle(&self, queue: &Queue) -> Result<(), DeviceError>
pub fn queue_wait_idle(&self, queue: &Queue) -> Result<(), DeviceError>
Sourcepub fn update_descriptor_sets<'a>(
&self,
descriptor_writes: impl IntoIterator<Item = WriteDescriptorSetBuilder<'a>>,
descriptor_copies: impl IntoIterator<Item = CopyDescriptorSetBuilder<'a>>,
)
pub fn update_descriptor_sets<'a>( &self, descriptor_writes: impl IntoIterator<Item = WriteDescriptorSetBuilder<'a>>, descriptor_copies: impl IntoIterator<Item = CopyDescriptorSetBuilder<'a>>, )
Sourcepub fn wait_for_fences<'a>(
&self,
fences: impl IntoIterator<Item = &'a Fence>,
wait_all: bool,
timeout: u64,
) -> VkResult<()>
pub fn wait_for_fences<'a>( &self, fences: impl IntoIterator<Item = &'a Fence>, wait_all: bool, timeout: u64, ) -> VkResult<()>
Sourcepub fn inner(&self) -> &Device
pub fn inner(&self) -> &Device
Access the ash::Device struct that self contains. Allows you to access vulkan device
functions.