Struct DeviceObject

Source
pub struct DeviceObject<Instance> { /* private fields */ }
Expand description

Opaque handle to a device object

Implementations§

Source§

impl<Instance> DeviceObject<Instance>

Source

pub const fn wrap_handle(handle: VkDevice, parent: Instance) -> Self

Source§

impl<Instance: Instance + Clone> DeviceObject<&Instance>

Source

pub fn clone_parent(self) -> DeviceObject<Instance>

Clones parent reference

Source§

impl<Instance: Instance> DeviceObject<Instance>

Source

pub fn new<PhysicalDevice: PhysicalDevice + InstanceChildTransferrable<ConcreteInstance = Instance>>( physical_device: PhysicalDevice, info: &DeviceCreateInfo<'_>, ) -> Result<Self>

Available on crate feature Implements only.

Create a new device instance

§Failures

On failure, this command returns

  • VK_ERROR_OUT_OF_HOST_MEMORY
  • VK_ERROR_OUT_OF_DEVICE_MEMORY
  • VK_ERROR_INITIALIZATION_FAILED
  • VK_ERROR_EXTENSION_NOT_PRESENT
  • VK_ERROR_FEATURE_NOT_PRESENT
  • VK_ERROR_TOO_MANY_OBJECTS
  • VK_ERROR_DEVICE_LOST
Source

pub const unsafe fn manage(handle: VkDevice, parent: Instance) -> Self

Constructs from raw handle

§Safety

the handle must be valid and not freed

Source

pub fn unmanage(self) -> (VkDevice, Instance)

Purges the construct (Drop will not be called for this resource)

Trait Implementations§

Source§

impl<Instance: Instance> Device for DeviceObject<Instance>

Source§

fn get_image_drm_format_modifier_properties_ext_fn( &self, ) -> PFN_vkGetImageDrmFormatModifierPropertiesEXT

Available on crate features Implements and VK_EXT_image_drm_format_modifier only.
Source§

fn get_fence_fd_khr_fn(&self) -> PFN_vkGetFenceFdKHR

Available on crate features Implements and VK_KHR_external_fence_fd only.
Source§

fn import_fence_fd_khr_fn(&self) -> PFN_vkImportFenceFdKHR

Available on crate features Implements and VK_KHR_external_fence_fd only.
Source§

fn get_memory_fd_khr_fn(&self) -> PFN_vkGetMemoryFdKHR

Available on crate features Implements and VK_KHR_external_memory_fd only.
Source§

fn get_memory_fd_properties_khr_fn(&self) -> PFN_vkGetMemoryFdPropertiesKHR

Available on crate features Implements and VK_KHR_external_memory_fd only.
Source§

fn get_memory_host_pointer_properties_ext_fn( &self, ) -> PFN_vkGetMemoryHostPointerPropertiesEXT

Available on crate features Implements and VK_EXT_external_memory_host only.
Source§

fn queue<'s>( &'s self, family_index: u32, queue_index: u32, ) -> QueueObject<&'s Self>

Available on crate feature Implements only.
Get a queue handle from a device
Source§

fn new_fence_raw( &self, info: &FenceCreateInfo<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkFence>

Available on crate feature Implements only.
Create a new fence object Read more
Source§

fn new_semaphore_raw( &self, info: &SemaphoreCreateInfo<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkSemaphore>

Available on crate feature Implements only.
Create a new queue semaphore object Read more
Source§

fn new_event_raw( &self, info: &EventCreateInfo, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkEvent>

Available on crate feature Implements only.
Create a new event object Read more
Source§

fn allocate_memory( &self, info: &MemoryAllocateInfo<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkDeviceMemory>

Available on crate feature Implements only.
Allocate device memory Read more
Source§

fn new_buffer_raw( &self, info: &BufferCreateInfo<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkBuffer>

Available on crate feature Implements only.
Create a new buffer object Read more
Source§

fn new_buffer_view_raw( &self, info: &BufferViewCreateInfo<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkBufferView>

Available on crate feature Implements only.
Create a new buffer view object Read more
Source§

fn new_sampler_raw( &self, info: &SamplerCreateInfo, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkSampler>

Available on crate feature Implements only.
Create a new sampler object Read more
Source§

fn new_image_raw( &self, info: &ImageCreateInfo<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkImage>

Available on crate feature Implements only.
Create a new image object Read more
Source§

fn new_image_view_raw( &self, info: &ImageViewCreateInfo<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkImageView>

Available on crate feature Implements only.
Create a new image view from an existing image Read more
Source§

fn new_render_pass( &self, info: &RenderPassCreateInfo<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkRenderPass>

Available on crate feature Implements only.
Create a new render pass object Read more
Source§

fn new_render_pass2( &self, info: &RenderPassCreateInfo2<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkRenderPass>

Available on crate features Implements and VK_KHR_create_renderpass2 only.
Create a new render pass object Read more
Source§

fn new_framebuffer_raw( &self, info: &FramebufferCreateInfo<'_, '_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkFramebuffer>

Available on crate feature Implements only.
Create a new framebuffer object Read more
Source§

fn new_shader_module_raw( &self, info: &ShaderModuleCreateInfo<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkShaderModule>

Available on crate feature Implements only.
Creates a new shader module object Read more
Source§

fn new_pipeline_cache_raw( &self, info: &PipelineCacheCreateInfo<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkPipelineCache>

Available on crate feature Implements only.
Create a new pipeline cache Read more
Source§

fn new_pipeline_layout_raw( &self, info: &PipelineLayoutCreateInfo<'_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkPipelineLayout>

Available on crate feature Implements only.
Create a new pipeline layout object Read more
Source§

unsafe fn new_graphics_pipelines_raw( &self, infos: &[GraphicsPipelineCreateInfo<'_>], cache: Option<VkPipelineCache>, allocation_callbacks: Option<&VkAllocationCallbacks>, objects: &mut [VkPipeline], ) -> Result<()>

Available on crate feature Implements only.
Create graphics pipelines Read more
Source§

fn new_graphics_pipelines<'s>( &'s self, infos: &[GraphicsPipelineCreateInfo<'_>], cache: Option<&(impl VkHandle<Handle = VkPipelineCache> + ?Sized)>, ) -> Result<Vec<PipelineObject<&'s Self>>>

Available on crate features Implements and alloc only.
Create graphics pipelines Read more
Source§

fn new_graphics_pipeline_array<'s, const N: usize>( &'s self, infos: &[GraphicsPipelineCreateInfo<'_>; N], cache: Option<&(impl VkHandle<Handle = VkPipelineCache> + ?Sized)>, ) -> Result<[PipelineObject<&'s Self>; N]>

Available on crate feature Implements only.
Create graphics pipelines Read more
Source§

unsafe fn new_compute_pipelines_raw( &self, infos: &[ComputePipelineCreateInfo<'_>], cache: Option<VkPipelineCache>, allocation_callbacks: Option<&VkAllocationCallbacks>, objects: &mut [VkPipeline], ) -> Result<()>

Available on crate feature Implements only.
Create compute pipelines Read more
Source§

fn new_compute_pipelines<'s>( &'s self, infos: &[ComputePipelineCreateInfo<'_>], cache: Option<&(impl VkHandle<Handle = VkPipelineCache> + ?Sized)>, ) -> Result<Vec<PipelineObject<&'s Self>>>

Available on crate features Implements and alloc only.
Create compute pipelines Read more
Source§

fn new_compute_pipeline_array<'s, const N: usize>( &'s self, infos: &[ComputePipelineCreateInfo<'_>; N], cache: Option<&(impl VkHandle<Handle = VkPipelineCache> + ?Sized)>, ) -> Result<[PipelineObject<&'s Self>; N]>

Available on crate feature Implements only.
Create compute pipelines Read more
Source§

fn new_command_pool_raw( &self, info: &CommandPoolCreateInfo, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkCommandPool>

Available on crate feature Implements only.
Create a new command pool object Read more
Source§

fn new_query_pool_raw( &self, info: &QueryPoolCreateInfo, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkQueryPool>

Available on crate feature Implements only.
Create a new query pool object Read more
Source§

unsafe fn allocate_command_buffers<'s>( &'s self, info: &CommandBufferAllocateInfo<'_>, sink: &mut [CommandBufferObject<&'s Self>], ) -> Result<()>

Available on crate feature Implements only.
Allocate command buffers from an existing command pool Read more
Source§

unsafe fn allocate_command_buffers_alloc<'s>( &'s self, info: &CommandBufferAllocateInfo<'_>, ) -> Result<Vec<CommandBufferObject<&'s Self>>>

Available on crate features Implements and alloc only.
Allocate command buffers from an existing command pool Read more
Source§

unsafe fn allocate_command_buffer_array<'s, const N: usize>( &'s self, info: &CommandBufferFixedCountAllocateInfo<'_, N>, ) -> Result<[CommandBufferObject<&'s Self>; N]>

Available on crate feature Implements only.
Allocate command buffers from an existing command pool Read more
Source§

unsafe fn invalidate_memory_range( &self, ranges: &[MappedMemoryRange<'_>], ) -> Result<()>

Available on crate feature Implements only.
Invalidate MappedMemoryRanges Invalidating the memory range allows that device writes to the memory ranges which have been made visible to the VK_ACCESS_HOST_WRITE_BIT and VK_ACCESS_HOST_READ_BIT are made visible to the host Read more
Source§

unsafe fn flush_mapped_memory_ranges( &self, ranges: &[MappedMemoryRange<'_>], ) -> Result<()>

Available on crate feature Implements only.
Flush MappedMemoryRanges Flushing the memory range allows that host writes to the memory ranges can be made available to device access Read more
Source§

unsafe fn update_descriptor_sets_raw( &self, writes: &[VkWriteDescriptorSet], copies: &[VkCopyDescriptorSet], )

Available on crate feature Implements only.
Update the contents of descriptor set objects
Source§

fn update_descriptor_sets( &self, writes: &[DescriptorSetWriteInfo<'_>], copies: &[DescriptorSetCopyInfo], )

Available on crate features Implements and alloc only.
Update the contents of descriptor set objects
Source§

unsafe fn wait(&self) -> Result<()>

Available on crate feature Implements only.
Wait for a object to become idle Read more
Source§

unsafe fn get_image_sparse_memory_requirements2_count( &self, info: &ImageSparseMemoryRequirementsInfo2<'_>, count_sink: &mut MaybeUninit<u32>, sink_head_ptr: *mut VkSparseImageMemoryRequirements2KHR, )

Available on crate features Implements and VK_KHR_get_memory_requirements2 only.
Query the memory requirements for a sparse image Read more
Source§

unsafe fn bind_buffer_raw( &self, buffer: VkBuffer, memory: VkDeviceMemory, offset: VkDeviceSize, ) -> Result<()>

Available on crate feature Implements only.
Single binding for a buffer Read more
Source§

unsafe fn bind_buffers_raw( &self, bounds: &[VkBindBufferMemoryInfoKHR], ) -> Result<()>

Available on crate features Implements and VK_KHR_bind_memory2 only.
Multiple Binding for Buffers
Source§

unsafe fn bind_image_raw( &self, image: VkImage, memory: VkDeviceMemory, offset: VkDeviceSize, ) -> Result<()>

Available on crate feature Implements only.
Single binding for an image Read more
Source§

unsafe fn bind_images_raw( &self, bounds: &[VkBindImageMemoryInfoKHR], ) -> Result<()>

Available on crate features Implements and VK_KHR_bind_memory2 only.
Multiple Binding for Images
Source§

fn wait_multiple_fences( &self, objects: &[VkHandleRef<'_, VkFence>], wait_all: bool, timeout: Option<u64>, ) -> Result<bool>

Available on crate feature Implements only.
Wait for one or more fences to become signaled, returns Ok(true) if operation is timed out Read more
Source§

fn reset_multiple_fences( &self, objects: &[VkHandleRefMut<'_, VkFence>], ) -> Result<()>

Available on crate feature Implements only.
Resets one or more fence objects Read more
Source§

fn new_swapchain_raw( &self, info: &SwapchainCreateInfo<'_, '_>, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkSwapchainKHR>

Available on crate features Implements and VK_KHR_swapchain only.
Create a swapchain Read more
Source§

fn set_object_name(&self, info: &DebugUtilsObjectNameInfo<'_>) -> Result<()>

Available on crate features Implements and VK_EXT_debug_utils only.
Give a user-friendly name to an object. Read more
Source§

unsafe fn new_descriptor_update_template_raw( &self, info: &VkDescriptorUpdateTemplateCreateInfoKHR, allocation_callbacks: Option<&VkAllocationCallbacks>, ) -> Result<VkDescriptorUpdateTemplateKHR>

Available on crate features Implements and VK_KHR_descriptor_update_template only.
Create a new descriptor update template Read more
Source§

fn new_descriptor_update_template<'s>( &'s self, entries: &[VkDescriptorUpdateTemplateEntryKHR], dsl: Option<&impl DescriptorSetLayout>, ) -> Result<DescriptorUpdateTemplateObject<&'s Self>>

Available on crate feature Implements only.
Create a new descriptor update template Read more
Source§

unsafe fn memory_fd_properties( &self, handle_type: ExternalMemoryHandleTypeFd, handle: RawFd, sink: &mut MaybeUninit<VkMemoryFdPropertiesKHR>, ) -> Result<()>

Available on crate features Implements and VK_KHR_external_memory_fd only.
Get Properties of External Memory File Descriptors Read more
Source§

fn get_memory_fd(&self, info: &MemoryGetFdInfo<'_>) -> Result<RawFd>

Available on crate features Implements and VK_KHR_external_memory_fd only.
Get a POSIX file descriptor for a memory object Read more
Source§

unsafe fn memory_host_pointer_properties( &self, handle_type: ExternalMemoryHandleTypeHost, ptr: *mut c_void, sink: &mut MaybeUninit<VkMemoryHostPointerPropertiesEXT>, ) -> Result<()>

Available on crate features Implements and VK_EXT_external_memory_host only.
Get Properties of external memory host pointer Read more
Source§

fn import_fence_fd(&self, info: &ImportFenceFdInfo<'_>) -> Result<()>

Available on crate features Implements and VK_KHR_external_fence_fd only.
Import a fence from a POSIX file descriptor Read more
Source§

fn get_fence_fd(&self, info: &FenceFdGetInfo<'_>) -> Result<RawFd>

Available on crate features Implements and VK_KHR_external_fence_fd only.
Get a POSIX file descriptor handle for a type Read more
Source§

impl<Instance: Instance> DeviceExtCommandFunctionProvider for DeviceObject<Instance>

Available on crate feature Implements only.
Source§

fn cmd_set_sample_locations_ext_fn(&self) -> PFN_vkCmdSetSampleLocationsEXT

Available on crate feature VK_EXT_sample_locations only.
Source§

impl<Instance: Instance> DeviceFullScreenExclusiveExtension for DeviceObject<Instance>

Available on crate features Implements and VK_EXT_full_screen_exclusive only.
Source§

impl<Instance> Drop for DeviceObject<Instance>

Available on crate feature Implements only.
Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<Instance: Instance> InstanceChild for DeviceObject<Instance>

Source§

impl<Instance> VkHandle for DeviceObject<Instance>

Source§

type Handle = VkDevice

Source§

fn native_ptr(&self) -> Self::Handle

Retrieve an underlying handle
Source§

fn as_transparent_ref(&self) -> VkHandleRef<'_, Self::Handle>

Source§

impl<Instance> VkHandleMut for DeviceObject<Instance>

Source§

fn native_ptr_mut(&mut self) -> Self::Handle

Retrieve an underlying mutable handle
Source§

fn as_transparent_ref_mut(&mut self) -> VkHandleRefMut<'_, Self::Handle>

Source§

impl<Instance> VkObject for DeviceObject<Instance>

Source§

impl<Instance: Send> Send for DeviceObject<Instance>

Source§

impl<Instance: Sync> Sync for DeviceObject<Instance>

Auto Trait Implementations§

§

impl<Instance> !Freeze for DeviceObject<Instance>

§

impl<Instance> RefUnwindSafe for DeviceObject<Instance>
where Instance: RefUnwindSafe,

§

impl<Instance> Unpin for DeviceObject<Instance>
where Instance: Unpin,

§

impl<Instance> UnwindSafe for DeviceObject<Instance>
where Instance: UnwindSafe,

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.
Source§

impl<T> VkHandleExt for T
where T: VkHandle,

Source§

fn eq_handle(&self, other: &Self) -> bool
where Self::Handle: VkRawHandle,

Checks the equality between vulkan objects by their handle value.