Skip to main content

Device

Struct Device 

Source
pub struct Device {
    pub physical: Box<PhysicalDevice>,
    /* private fields */
}
Expand description

Opaque handle to a device object.

Fields§

§physical: Box<PhysicalDevice>

The selected physical device.

This contains the physical device’s advertised features, properties, limits, memory properties, queue families, and Vulkan extension support. Extension support is exposed with fields named after the Vulkan extension, for example device.physical.vk_khr_acceleration_structure.is_some().

Note: This field is read-only.

Implementations§

Source§

impl Device

Source

pub fn begin_command_buffer( this: &Self, cmd: CommandBuffer, begin_info: &CommandBufferBeginInfo<'_>, ) -> Result<(), DriverError>

Begins recording a command buffer on this device.

This is a thin wrapper around ash::Device::begin_command_buffer that maps Vulkan errors to DriverError variants.

Source

pub fn begin_debug_utils_label( this: &Self, command_buffer: CommandBuffer, label_name: impl AsRef<str>, ) -> Result<(), DriverError>

Begins a Vulkan debug label region on command_buffer when debug labeling is enabled.

Returns without doing any work if debug mode is false.

Source

pub fn cmd_pipeline_barrier2( this: &Self, command_buffer: CommandBuffer, dependency_info: &DependencyInfo<'_>, )

Records a pipeline barrier using the VK_KHR_synchronization2 extension or the Vulkan 1.3 core vkCmdPipelineBarrier2 path.

See vkCmdPipelineBarrier2 and VK_KHR_synchronization2.

Source

pub fn create(info: impl Into<DeviceInfo>) -> Result<Self, DriverError>

Constructs a new device using the given configuration.

This constructor is intended for headless or manually managed setups. It does not infer or enable display platform surface extensions. Use Self::try_from_display when the resulting device must be capable of later surface creation.

Source

pub fn create_fence(this: &Self, signaled: bool) -> Result<Fence, DriverError>

Creates a Vulkan fence on this device.

Pass true for signaled when the fence should begin in the signaled state.

See vkCreateFence.

Source

pub fn create_semaphore(this: &Self) -> Result<Semaphore, DriverError>

Creates a Vulkan binary semaphore on this device.

See vkCreateSemaphore.

Source

pub fn end_command_buffer( this: &Self, cmd: CommandBuffer, ) -> Result<(), DriverError>

Ends recording a command buffer on this device.

This is a thin wrapper around ash::Device::end_command_buffer that maps Vulkan errors to DriverError variants.

See vkEndCommandBuffer.

Source

pub fn end_debug_utils_label( this: &Self, command_buffer: CommandBuffer, ) -> Result<(), DriverError>

Ends a Vulkan debug label region on command_buffer when debug labeling is enabled.

Returns without doing any work if debug mode is false.

Source

pub fn queue_submit( this: &Self, queue: Queue, submits: &[SubmitInfo<'_>], fence: Fence, ) -> Result<(), DriverError>

Submits command buffers to a queue, optionally signaling a fence.

See vkQueueSubmit.

Source

pub fn queue_submit2( this: &Self, queue: Queue, submits: &[SubmitInfo2<'_>], fence: Fence, ) -> Result<(), DriverError>

Submits command buffers to a queue using the VK_KHR_synchronization2 extension or the Vulkan 1.3 core vkQueueSubmit2 path.

See vkQueueSubmit2 and VK_KHR_synchronization2.

Source

pub fn queue_wait_idle(this: &Self, queue: Queue) -> Result<(), DriverError>

Waits for queue idle.

Source

pub fn reset_fences(this: &Self, fences: &[Fence]) -> Result<(), DriverError>

Resets one or more fences to the unsignaled state.

See vkResetFences.

Source

pub fn set_debug_utils_object_name<T>( this: &Self, object_handle: T, object_name: impl AsRef<str>, ) -> Result<(), DriverError>
where T: Handle + Copy,

Assigns a Vulkan debug-utils name to handle when debug labeling is enabled.

Returns without doing any work if debug mode is false.

Source

pub unsafe fn try_from_ash( device: Device, physical_device: PhysicalDevice, ) -> Result<Self, DriverError>

Loads an existing ash Vulkan device that may have been created by other means.

§Safety

device must have been created from physical_device and must have all queues, extensions, and features expected by vk-graph. The device must not be destroyed outside this wrapper while any cloned Device or resources created from it remain alive.

Source

pub fn try_from_display( display: impl HasDisplayHandle, info: impl Into<DeviceInfo>, ) -> Result<Self, DriverError>

Constructs a new device using the given configuration.

Source

pub fn try_from_physical_device( physical_device: PhysicalDevice, ) -> Result<Self, DriverError>

Constructs a new device using the given physical device.

Source

pub fn try_set_debug_utils_object_name<T>( this: &Self, object_handle: T, object_name: impl AsRef<str>, )
where T: Handle + Copy,

Assigns a Vulkan debug-utils name to handle when debug labeling is enabled.

Returns without doing any work if debug mode is false.

Source

pub fn wait_idle(this: &Self) -> Result<(), DriverError>

Waits for device idle.

Source

pub fn with_queue<R>( this: &Self, queue_family_index: u32, queue_index: u32, f: impl FnOnce(Queue) -> R, ) -> R

Provides locked access to a device queue.

Acquires the mutex for the queue at the given family and index, calls f with the vk::Queue, and releases the mutex after f returns.

§Panics

Panics if queue_family_index or queue_index is out of range for this device.

Methods from Deref<Target = Device>§

Source

pub fn handle(&self) -> Device

Source

pub fn fp_v1_3(&self) -> &DeviceFnV1_3

Source

pub unsafe fn create_private_data_slot( &self, create_info: &PrivateDataSlotCreateInfo<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<PrivateDataSlot, Result>

Source

pub unsafe fn destroy_private_data_slot( &self, private_data_slot: PrivateDataSlot, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn set_private_data<T>( &self, object: T, private_data_slot: PrivateDataSlot, data: u64, ) -> Result<(), Result>
where T: Handle,

Source

pub unsafe fn get_private_data<T>( &self, object: T, private_data_slot: PrivateDataSlot, ) -> u64
where T: Handle,

Source

pub unsafe fn cmd_pipeline_barrier2( &self, command_buffer: CommandBuffer, dependency_info: &DependencyInfo<'_>, )

Source

pub unsafe fn cmd_reset_event2( &self, command_buffer: CommandBuffer, event: Event, stage_mask: PipelineStageFlags2, )

Source

pub unsafe fn cmd_set_event2( &self, command_buffer: CommandBuffer, event: Event, dependency_info: &DependencyInfo<'_>, )

Source

pub unsafe fn cmd_wait_events2( &self, command_buffer: CommandBuffer, events: &[Event], dependency_infos: &[DependencyInfo<'_>], )

Source

pub unsafe fn cmd_write_timestamp2( &self, command_buffer: CommandBuffer, stage: PipelineStageFlags2, query_pool: QueryPool, query: u32, )

Source

pub unsafe fn queue_submit2( &self, queue: Queue, submits: &[SubmitInfo2<'_>], fence: Fence, ) -> Result<(), Result>

Source

pub unsafe fn cmd_copy_buffer2( &self, command_buffer: CommandBuffer, copy_buffer_info: &CopyBufferInfo2<'_>, )

Source

pub unsafe fn cmd_copy_image2( &self, command_buffer: CommandBuffer, copy_image_info: &CopyImageInfo2<'_>, )

Source

pub unsafe fn cmd_copy_buffer_to_image2( &self, command_buffer: CommandBuffer, copy_buffer_to_image_info: &CopyBufferToImageInfo2<'_>, )

Source

pub unsafe fn cmd_copy_image_to_buffer2( &self, command_buffer: CommandBuffer, copy_image_to_buffer_info: &CopyImageToBufferInfo2<'_>, )

Source

pub unsafe fn cmd_blit_image2( &self, command_buffer: CommandBuffer, blit_image_info: &BlitImageInfo2<'_>, )

Source

pub unsafe fn cmd_resolve_image2( &self, command_buffer: CommandBuffer, resolve_image_info: &ResolveImageInfo2<'_>, )

Source

pub unsafe fn cmd_begin_rendering( &self, command_buffer: CommandBuffer, rendering_info: &RenderingInfo<'_>, )

Source

pub unsafe fn cmd_end_rendering(&self, command_buffer: CommandBuffer)

Source

pub unsafe fn cmd_set_cull_mode( &self, command_buffer: CommandBuffer, cull_mode: CullModeFlags, )

Source

pub unsafe fn cmd_set_front_face( &self, command_buffer: CommandBuffer, front_face: FrontFace, )

Source

pub unsafe fn cmd_set_primitive_topology( &self, command_buffer: CommandBuffer, primitive_topology: PrimitiveTopology, )

Source

pub unsafe fn cmd_set_viewport_with_count( &self, command_buffer: CommandBuffer, viewports: &[Viewport], )

Source

pub unsafe fn cmd_set_scissor_with_count( &self, command_buffer: CommandBuffer, scissors: &[Rect2D], )

Source

pub unsafe fn cmd_bind_vertex_buffers2( &self, command_buffer: CommandBuffer, first_binding: u32, buffers: &[Buffer], offsets: &[u64], sizes: Option<&[u64]>, strides: Option<&[u64]>, )

Source

pub unsafe fn cmd_set_depth_test_enable( &self, command_buffer: CommandBuffer, depth_test_enable: bool, )

Source

pub unsafe fn cmd_set_depth_write_enable( &self, command_buffer: CommandBuffer, depth_write_enable: bool, )

Source

pub unsafe fn cmd_set_depth_compare_op( &self, command_buffer: CommandBuffer, depth_compare_op: CompareOp, )

Source

pub unsafe fn cmd_set_depth_bounds_test_enable( &self, command_buffer: CommandBuffer, depth_bounds_test_enable: bool, )

Source

pub unsafe fn cmd_set_stencil_test_enable( &self, command_buffer: CommandBuffer, stencil_test_enable: bool, )

Source

pub unsafe fn cmd_set_stencil_op( &self, command_buffer: CommandBuffer, face_mask: StencilFaceFlags, fail_op: StencilOp, pass_op: StencilOp, depth_fail_op: StencilOp, compare_op: CompareOp, )

Source

pub unsafe fn cmd_set_rasterizer_discard_enable( &self, command_buffer: CommandBuffer, rasterizer_discard_enable: bool, )

Source

pub unsafe fn cmd_set_depth_bias_enable( &self, command_buffer: CommandBuffer, depth_bias_enable: bool, )

Source

pub unsafe fn cmd_set_primitive_restart_enable( &self, command_buffer: CommandBuffer, primitive_restart_enable: bool, )

Source

pub unsafe fn get_device_buffer_memory_requirements( &self, memory_requirements: &DeviceBufferMemoryRequirements<'_>, out: &mut MemoryRequirements2<'_>, )

Source

pub unsafe fn get_device_image_memory_requirements( &self, memory_requirements: &DeviceImageMemoryRequirements<'_>, out: &mut MemoryRequirements2<'_>, )

Source

pub unsafe fn get_device_image_sparse_memory_requirements_len( &self, memory_requirements: &DeviceImageMemoryRequirements<'_>, ) -> usize

Retrieve the number of elements to pass to get_device_image_sparse_memory_requirements()

Source

pub unsafe fn get_device_image_sparse_memory_requirements( &self, memory_requirements: &DeviceImageMemoryRequirements<'_>, out: &mut [SparseImageMemoryRequirements2<'_>], )

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

Call get_device_image_sparse_memory_requirements_len() to query the number of elements to pass to out. Be sure to Default::default()-initialize these elements and optionally set their p_next pointer.

Source

pub fn fp_v1_2(&self) -> &DeviceFnV1_2

Source

pub unsafe fn cmd_draw_indirect_count( &self, command_buffer: CommandBuffer, buffer: Buffer, offset: u64, count_buffer: Buffer, count_buffer_offset: u64, max_draw_count: u32, stride: u32, )

Source

pub unsafe fn cmd_draw_indexed_indirect_count( &self, command_buffer: CommandBuffer, buffer: Buffer, offset: u64, count_buffer: Buffer, count_buffer_offset: u64, max_draw_count: u32, stride: u32, )

Source

pub unsafe fn create_render_pass2( &self, create_info: &RenderPassCreateInfo2<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<RenderPass, Result>

Source

pub unsafe fn cmd_begin_render_pass2( &self, command_buffer: CommandBuffer, render_pass_begin_info: &RenderPassBeginInfo<'_>, subpass_begin_info: &SubpassBeginInfo<'_>, )

Source

pub unsafe fn cmd_next_subpass2( &self, command_buffer: CommandBuffer, subpass_begin_info: &SubpassBeginInfo<'_>, subpass_end_info: &SubpassEndInfo<'_>, )

Source

pub unsafe fn cmd_end_render_pass2( &self, command_buffer: CommandBuffer, subpass_end_info: &SubpassEndInfo<'_>, )

Source

pub unsafe fn reset_query_pool( &self, query_pool: QueryPool, first_query: u32, query_count: u32, )

Source

pub unsafe fn get_semaphore_counter_value( &self, semaphore: Semaphore, ) -> Result<u64, Result>

Source

pub unsafe fn wait_semaphores( &self, wait_info: &SemaphoreWaitInfo<'_>, timeout: u64, ) -> Result<(), Result>

Source

pub unsafe fn signal_semaphore( &self, signal_info: &SemaphoreSignalInfo<'_>, ) -> Result<(), Result>

Source

pub unsafe fn get_buffer_device_address( &self, info: &BufferDeviceAddressInfo<'_>, ) -> u64

Source

pub unsafe fn get_buffer_opaque_capture_address( &self, info: &BufferDeviceAddressInfo<'_>, ) -> u64

Source

pub unsafe fn get_device_memory_opaque_capture_address( &self, info: &DeviceMemoryOpaqueCaptureAddressInfo<'_>, ) -> u64

Source

pub fn fp_v1_1(&self) -> &DeviceFnV1_1

Source

pub unsafe fn bind_buffer_memory2( &self, bind_infos: &[BindBufferMemoryInfo<'_>], ) -> Result<(), Result>

Source

pub unsafe fn bind_image_memory2( &self, bind_infos: &[BindImageMemoryInfo<'_>], ) -> Result<(), Result>

Source

pub unsafe fn get_device_group_peer_memory_features( &self, heap_index: u32, local_device_index: u32, remote_device_index: u32, ) -> PeerMemoryFeatureFlags

Source

pub unsafe fn cmd_set_device_mask( &self, command_buffer: CommandBuffer, device_mask: u32, )

Source

pub unsafe fn cmd_dispatch_base( &self, command_buffer: CommandBuffer, base_group_x: u32, base_group_y: u32, base_group_z: u32, group_count_x: u32, group_count_y: u32, group_count_z: u32, )

Source

pub unsafe fn get_image_memory_requirements2( &self, info: &ImageMemoryRequirementsInfo2<'_>, out: &mut MemoryRequirements2<'_>, )

Source

pub unsafe fn get_buffer_memory_requirements2( &self, info: &BufferMemoryRequirementsInfo2<'_>, out: &mut MemoryRequirements2<'_>, )

Source

pub unsafe fn get_image_sparse_memory_requirements2_len( &self, info: &ImageSparseMemoryRequirementsInfo2<'_>, ) -> usize

Retrieve the number of elements to pass to get_image_sparse_memory_requirements2()

Source

pub unsafe fn get_image_sparse_memory_requirements2( &self, info: &ImageSparseMemoryRequirementsInfo2<'_>, out: &mut [SparseImageMemoryRequirements2<'_>], )

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

Call get_image_sparse_memory_requirements2_len() to query the number of elements to pass to out. Be sure to Default::default()-initialize these elements and optionally set their p_next pointer.

Source

pub unsafe fn trim_command_pool( &self, command_pool: CommandPool, flags: CommandPoolTrimFlags, )

Source

pub unsafe fn get_device_queue2( &self, queue_info: &DeviceQueueInfo2<'_>, ) -> Queue

Source

pub unsafe fn create_sampler_ycbcr_conversion( &self, create_info: &SamplerYcbcrConversionCreateInfo<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<SamplerYcbcrConversion, Result>

Source

pub unsafe fn destroy_sampler_ycbcr_conversion( &self, ycbcr_conversion: SamplerYcbcrConversion, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn create_descriptor_update_template( &self, create_info: &DescriptorUpdateTemplateCreateInfo<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<DescriptorUpdateTemplate, Result>

Source

pub unsafe fn destroy_descriptor_update_template( &self, descriptor_update_template: DescriptorUpdateTemplate, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn update_descriptor_set_with_template( &self, descriptor_set: DescriptorSet, descriptor_update_template: DescriptorUpdateTemplate, data: *const c_void, )

Source

pub unsafe fn get_descriptor_set_layout_support( &self, create_info: &DescriptorSetLayoutCreateInfo<'_>, out: &mut DescriptorSetLayoutSupport<'_>, )

Source

pub fn fp_v1_0(&self) -> &DeviceFnV1_0

Source

pub unsafe fn destroy_device( &self, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn destroy_sampler( &self, sampler: Sampler, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn free_memory( &self, memory: DeviceMemory, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn free_command_buffers( &self, command_pool: CommandPool, command_buffers: &[CommandBuffer], )

Source

pub unsafe fn create_event( &self, create_info: &EventCreateInfo<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<Event, Result>

Source

pub unsafe fn get_event_status(&self, event: Event) -> Result<bool, Result>

Returns true if the event was set, and false if the event was reset, otherwise it will return the error code. https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetEventStatus.html

Source

pub unsafe fn set_event(&self, event: Event) -> Result<(), Result>

Source

pub unsafe fn reset_event(&self, event: Event) -> Result<(), Result>

Source

pub unsafe fn cmd_set_event( &self, command_buffer: CommandBuffer, event: Event, stage_mask: PipelineStageFlags, )

Source

pub unsafe fn cmd_reset_event( &self, command_buffer: CommandBuffer, event: Event, stage_mask: PipelineStageFlags, )

Source

pub unsafe fn cmd_wait_events( &self, command_buffer: CommandBuffer, events: &[Event], src_stage_mask: PipelineStageFlags, dst_stage_mask: PipelineStageFlags, memory_barriers: &[MemoryBarrier<'_>], buffer_memory_barriers: &[BufferMemoryBarrier<'_>], image_memory_barriers: &[ImageMemoryBarrier<'_>], )

Source

pub unsafe fn destroy_fence( &self, fence: Fence, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn destroy_event( &self, event: Event, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn destroy_image( &self, image: Image, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn destroy_command_pool( &self, pool: CommandPool, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn destroy_image_view( &self, image_view: ImageView, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn destroy_render_pass( &self, renderpass: RenderPass, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn destroy_framebuffer( &self, framebuffer: Framebuffer, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn destroy_pipeline_layout( &self, pipeline_layout: PipelineLayout, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn destroy_pipeline_cache( &self, pipeline_cache: PipelineCache, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn destroy_buffer( &self, buffer: Buffer, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn destroy_shader_module( &self, shader: ShaderModule, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn destroy_pipeline( &self, pipeline: Pipeline, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn destroy_semaphore( &self, semaphore: Semaphore, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn destroy_descriptor_pool( &self, pool: DescriptorPool, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn destroy_query_pool( &self, pool: QueryPool, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn destroy_descriptor_set_layout( &self, layout: DescriptorSetLayout, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn free_descriptor_sets( &self, pool: DescriptorPool, descriptor_sets: &[DescriptorSet], ) -> Result<(), Result>

Source

pub unsafe fn update_descriptor_sets( &self, descriptor_writes: &[WriteDescriptorSet<'_>], descriptor_copies: &[CopyDescriptorSet<'_>], )

Source

pub unsafe fn create_sampler( &self, create_info: &SamplerCreateInfo<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<Sampler, Result>

Source

pub unsafe fn cmd_blit_image( &self, command_buffer: CommandBuffer, src_image: Image, src_image_layout: ImageLayout, dst_image: Image, dst_image_layout: ImageLayout, regions: &[ImageBlit], filter: Filter, )

Source

pub unsafe fn cmd_resolve_image( &self, command_buffer: CommandBuffer, src_image: Image, src_image_layout: ImageLayout, dst_image: Image, dst_image_layout: ImageLayout, regions: &[ImageResolve], )

Source

pub unsafe fn cmd_fill_buffer( &self, command_buffer: CommandBuffer, buffer: Buffer, offset: u64, size: u64, data: u32, )

Source

pub unsafe fn cmd_update_buffer( &self, command_buffer: CommandBuffer, buffer: Buffer, offset: u64, data: &[u8], )

Source

pub unsafe fn cmd_copy_buffer( &self, command_buffer: CommandBuffer, src_buffer: Buffer, dst_buffer: Buffer, regions: &[BufferCopy], )

Source

pub unsafe fn cmd_copy_image_to_buffer( &self, command_buffer: CommandBuffer, src_image: Image, src_image_layout: ImageLayout, dst_buffer: Buffer, regions: &[BufferImageCopy], )

Source

pub unsafe fn cmd_copy_buffer_to_image( &self, command_buffer: CommandBuffer, src_buffer: Buffer, dst_image: Image, dst_image_layout: ImageLayout, regions: &[BufferImageCopy], )

Source

pub unsafe fn cmd_copy_image( &self, command_buffer: CommandBuffer, src_image: Image, src_image_layout: ImageLayout, dst_image: Image, dst_image_layout: ImageLayout, regions: &[ImageCopy], )

Source

pub unsafe fn allocate_descriptor_sets( &self, allocate_info: &DescriptorSetAllocateInfo<'_>, ) -> Result<Vec<DescriptorSet>, Result>

Source

pub unsafe fn create_descriptor_set_layout( &self, create_info: &DescriptorSetLayoutCreateInfo<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<DescriptorSetLayout, Result>

Source

pub unsafe fn device_wait_idle(&self) -> Result<(), Result>

Source

pub unsafe fn create_descriptor_pool( &self, create_info: &DescriptorPoolCreateInfo<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<DescriptorPool, Result>

Source

pub unsafe fn reset_descriptor_pool( &self, pool: DescriptorPool, flags: DescriptorPoolResetFlags, ) -> Result<(), Result>

Source

pub unsafe fn reset_command_pool( &self, command_pool: CommandPool, flags: CommandPoolResetFlags, ) -> Result<(), Result>

Source

pub unsafe fn reset_command_buffer( &self, command_buffer: CommandBuffer, flags: CommandBufferResetFlags, ) -> Result<(), Result>

Source

pub unsafe fn reset_fences(&self, fences: &[Fence]) -> Result<(), Result>

Source

pub unsafe fn cmd_bind_index_buffer( &self, command_buffer: CommandBuffer, buffer: Buffer, offset: u64, index_type: IndexType, )

Source

pub unsafe fn cmd_clear_color_image( &self, command_buffer: CommandBuffer, image: Image, image_layout: ImageLayout, clear_color_value: &ClearColorValue, ranges: &[ImageSubresourceRange], )

Source

pub unsafe fn cmd_clear_depth_stencil_image( &self, command_buffer: CommandBuffer, image: Image, image_layout: ImageLayout, clear_depth_stencil_value: &ClearDepthStencilValue, ranges: &[ImageSubresourceRange], )

Source

pub unsafe fn cmd_clear_attachments( &self, command_buffer: CommandBuffer, attachments: &[ClearAttachment], rects: &[ClearRect], )

Source

pub unsafe fn cmd_draw_indexed( &self, command_buffer: CommandBuffer, index_count: u32, instance_count: u32, first_index: u32, vertex_offset: i32, first_instance: u32, )

Source

pub unsafe fn cmd_draw_indexed_indirect( &self, command_buffer: CommandBuffer, buffer: Buffer, offset: u64, draw_count: u32, stride: u32, )

Source

pub unsafe fn cmd_execute_commands( &self, primary_command_buffer: CommandBuffer, secondary_command_buffers: &[CommandBuffer], )

Source

pub unsafe fn cmd_bind_descriptor_sets( &self, command_buffer: CommandBuffer, pipeline_bind_point: PipelineBindPoint, layout: PipelineLayout, first_set: u32, descriptor_sets: &[DescriptorSet], dynamic_offsets: &[u32], )

Source

pub unsafe fn cmd_copy_query_pool_results( &self, command_buffer: CommandBuffer, query_pool: QueryPool, first_query: u32, query_count: u32, dst_buffer: Buffer, dst_offset: u64, stride: u64, flags: QueryResultFlags, )

Source

pub unsafe fn cmd_push_constants( &self, command_buffer: CommandBuffer, layout: PipelineLayout, stage_flags: ShaderStageFlags, offset: u32, constants: &[u8], )

Source

pub unsafe fn cmd_begin_render_pass( &self, command_buffer: CommandBuffer, render_pass_begin: &RenderPassBeginInfo<'_>, contents: SubpassContents, )

Source

pub unsafe fn cmd_next_subpass( &self, command_buffer: CommandBuffer, contents: SubpassContents, )

Source

pub unsafe fn cmd_bind_pipeline( &self, command_buffer: CommandBuffer, pipeline_bind_point: PipelineBindPoint, pipeline: Pipeline, )

Source

pub unsafe fn cmd_set_scissor( &self, command_buffer: CommandBuffer, first_scissor: u32, scissors: &[Rect2D], )

Source

pub unsafe fn cmd_set_line_width( &self, command_buffer: CommandBuffer, line_width: f32, )

Source

pub unsafe fn cmd_bind_vertex_buffers( &self, command_buffer: CommandBuffer, first_binding: u32, buffers: &[Buffer], offsets: &[u64], )

Source

pub unsafe fn cmd_end_render_pass(&self, command_buffer: CommandBuffer)

Source

pub unsafe fn cmd_draw( &self, command_buffer: CommandBuffer, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32, )

Source

pub unsafe fn cmd_draw_indirect( &self, command_buffer: CommandBuffer, buffer: Buffer, offset: u64, draw_count: u32, stride: u32, )

Source

pub unsafe fn cmd_dispatch( &self, command_buffer: CommandBuffer, group_count_x: u32, group_count_y: u32, group_count_z: u32, )

Source

pub unsafe fn cmd_dispatch_indirect( &self, command_buffer: CommandBuffer, buffer: Buffer, offset: u64, )

Source

pub unsafe fn cmd_set_viewport( &self, command_buffer: CommandBuffer, first_viewport: u32, viewports: &[Viewport], )

Source

pub unsafe fn cmd_set_depth_bias( &self, command_buffer: CommandBuffer, constant_factor: f32, clamp: f32, slope_factor: f32, )

Source

pub unsafe fn cmd_set_blend_constants( &self, command_buffer: CommandBuffer, blend_constants: &[f32; 4], )

Source

pub unsafe fn cmd_set_depth_bounds( &self, command_buffer: CommandBuffer, min_depth_bounds: f32, max_depth_bounds: f32, )

Source

pub unsafe fn cmd_set_stencil_compare_mask( &self, command_buffer: CommandBuffer, face_mask: StencilFaceFlags, compare_mask: u32, )

Source

pub unsafe fn cmd_set_stencil_write_mask( &self, command_buffer: CommandBuffer, face_mask: StencilFaceFlags, write_mask: u32, )

Source

pub unsafe fn cmd_set_stencil_reference( &self, command_buffer: CommandBuffer, face_mask: StencilFaceFlags, reference: u32, )

Source

pub unsafe fn get_query_pool_results<T>( &self, query_pool: QueryPool, first_query: u32, data: &mut [T], flags: QueryResultFlags, ) -> Result<(), Result>

Source

pub unsafe fn cmd_begin_query( &self, command_buffer: CommandBuffer, query_pool: QueryPool, query: u32, flags: QueryControlFlags, )

Source

pub unsafe fn cmd_end_query( &self, command_buffer: CommandBuffer, query_pool: QueryPool, query: u32, )

Source

pub unsafe fn cmd_reset_query_pool( &self, command_buffer: CommandBuffer, pool: QueryPool, first_query: u32, query_count: u32, )

Source

pub unsafe fn cmd_write_timestamp( &self, command_buffer: CommandBuffer, pipeline_stage: PipelineStageFlags, query_pool: QueryPool, query: u32, )

Source

pub unsafe fn create_semaphore( &self, create_info: &SemaphoreCreateInfo<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<Semaphore, Result>

Source

pub unsafe fn create_graphics_pipelines( &self, pipeline_cache: PipelineCache, create_infos: &[GraphicsPipelineCreateInfo<'_>], allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<Vec<Pipeline>, (Vec<Pipeline>, Result)>

Source

pub unsafe fn create_compute_pipelines( &self, pipeline_cache: PipelineCache, create_infos: &[ComputePipelineCreateInfo<'_>], allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<Vec<Pipeline>, (Vec<Pipeline>, Result)>

Source

pub unsafe fn create_buffer( &self, create_info: &BufferCreateInfo<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<Buffer, Result>

Source

pub unsafe fn create_pipeline_layout( &self, create_info: &PipelineLayoutCreateInfo<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<PipelineLayout, Result>

Source

pub unsafe fn create_pipeline_cache( &self, create_info: &PipelineCacheCreateInfo<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<PipelineCache, Result>

Source

pub unsafe fn get_pipeline_cache_data( &self, pipeline_cache: PipelineCache, ) -> Result<Vec<u8>, Result>

Source

pub unsafe fn merge_pipeline_caches( &self, dst_cache: PipelineCache, src_caches: &[PipelineCache], ) -> Result<(), Result>

Source

pub unsafe fn map_memory( &self, memory: DeviceMemory, offset: u64, size: u64, flags: MemoryMapFlags, ) -> Result<*mut c_void, Result>

Source

pub unsafe fn unmap_memory(&self, memory: DeviceMemory)

Source

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

Source

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

Source

pub unsafe fn create_framebuffer( &self, create_info: &FramebufferCreateInfo<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<Framebuffer, Result>

Source

pub unsafe fn get_device_queue( &self, queue_family_index: u32, queue_index: u32, ) -> Queue

Source

pub unsafe fn cmd_pipeline_barrier( &self, command_buffer: CommandBuffer, src_stage_mask: PipelineStageFlags, dst_stage_mask: PipelineStageFlags, dependency_flags: DependencyFlags, memory_barriers: &[MemoryBarrier<'_>], buffer_memory_barriers: &[BufferMemoryBarrier<'_>], image_memory_barriers: &[ImageMemoryBarrier<'_>], )

Source

pub unsafe fn create_render_pass( &self, create_info: &RenderPassCreateInfo<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<RenderPass, Result>

Source

pub unsafe fn begin_command_buffer( &self, command_buffer: CommandBuffer, begin_info: &CommandBufferBeginInfo<'_>, ) -> Result<(), Result>

Source

pub unsafe fn end_command_buffer( &self, command_buffer: CommandBuffer, ) -> Result<(), Result>

Source

pub unsafe fn wait_for_fences( &self, fences: &[Fence], wait_all: bool, timeout: u64, ) -> Result<(), Result>

Source

pub unsafe fn get_fence_status(&self, fence: Fence) -> Result<bool, Result>

Source

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

Source

pub unsafe fn queue_submit( &self, queue: Queue, submits: &[SubmitInfo<'_>], fence: Fence, ) -> Result<(), Result>

Source

pub unsafe fn queue_bind_sparse( &self, queue: Queue, bind_info: &[BindSparseInfo<'_>], fence: Fence, ) -> Result<(), Result>

Source

pub unsafe fn create_buffer_view( &self, create_info: &BufferViewCreateInfo<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<BufferView, Result>

Source

pub unsafe fn destroy_buffer_view( &self, buffer_view: BufferView, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn create_image_view( &self, create_info: &ImageViewCreateInfo<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<ImageView, Result>

Source

pub unsafe fn allocate_command_buffers( &self, allocate_info: &CommandBufferAllocateInfo<'_>, ) -> Result<Vec<CommandBuffer>, Result>

Source

pub unsafe fn create_command_pool( &self, create_info: &CommandPoolCreateInfo<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<CommandPool, Result>

Source

pub unsafe fn create_query_pool( &self, create_info: &QueryPoolCreateInfo<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<QueryPool, Result>

Source

pub unsafe fn create_image( &self, create_info: &ImageCreateInfo<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<Image, Result>

Source

pub unsafe fn get_image_subresource_layout( &self, image: Image, subresource: ImageSubresource, ) -> SubresourceLayout

Source

pub unsafe fn get_image_memory_requirements( &self, image: Image, ) -> MemoryRequirements

Source

pub unsafe fn get_buffer_memory_requirements( &self, buffer: Buffer, ) -> MemoryRequirements

Source

pub unsafe fn allocate_memory( &self, allocate_info: &MemoryAllocateInfo<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<DeviceMemory, Result>

Source

pub unsafe fn create_shader_module( &self, create_info: &ShaderModuleCreateInfo<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<ShaderModule, Result>

Source

pub unsafe fn create_fence( &self, create_info: &FenceCreateInfo<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<Fence, Result>

Source

pub unsafe fn bind_buffer_memory( &self, buffer: Buffer, device_memory: DeviceMemory, offset: u64, ) -> Result<(), Result>

Source

pub unsafe fn bind_image_memory( &self, image: Image, device_memory: DeviceMemory, offset: u64, ) -> Result<(), Result>

Source

pub unsafe fn get_render_area_granularity( &self, render_pass: RenderPass, ) -> Extent2D

Source

pub unsafe fn get_device_memory_commitment(&self, memory: DeviceMemory) -> u64

Source

pub unsafe fn get_image_sparse_memory_requirements( &self, image: Image, ) -> Vec<SparseImageMemoryRequirements>

Trait Implementations§

Source§

impl Clone for Device

Source§

fn clone(&self) -> Device

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Device

Source§

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

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

impl Deref for Device

Source§

type Target = Device

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Eq for Device

Source§

impl PartialEq for Device

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.