Struct CmdRecord

Source
pub struct CmdRecord<'d, ExtFnProvider: 'd + ?Sized> { /* private fields */ }
Available on crate feature Implements only.
Expand description

The recording state of command buffers

Implementations§

Source§

impl<'d, ExtFnProvider: 'd + ?Sized> CmdRecord<'d, ExtFnProvider>

Source

pub const fn new( ptr: VkHandleRefMut<'d, VkCommandBuffer>, ext_fn_provider: &'d ExtFnProvider, ) -> Self

Source§

impl<'d, ExtFnProvider: 'd + ?Sized> CmdRecord<'d, ExtFnProvider>

Common Commands: End Recording

Source

pub fn end(self) -> Result<()>

Finish recording a command buffer

Source§

impl<'d, ExtFnProvider: 'd + ?Sized> CmdRecord<'d, ExtFnProvider>

Graphics Commands: Manipulating with Render Passes

Source

pub fn begin_render_pass( self, info: &RenderPassBeginInfo<'_>, contents: SubpassContents, ) -> Self

Begin a new render pass

Source

pub fn next_subpass(self, contents: SubpassContents) -> Self

Transition to the next subpass of a render pass

Source

pub fn end_render_pass(self) -> Self

End the current render pass

Source

pub fn begin_render_pass2( self, begin_info: &RenderPassBeginInfo<'_>, subpass_begin_info: &SubpassBeginInfo, ) -> Self

Available on crate feature Allow1_2APIs only.
Source

pub fn next_subpass2( self, subpass_begin_info: &SubpassBeginInfo, subpass_end_info: &SubpassEndInfo, ) -> Self

Available on crate feature Allow1_2APIs only.
Source

pub fn end_render_pass2(self, subpass_end_info: &SubpassEndInfo) -> Self

Available on crate feature Allow1_2APIs only.
Source§

impl<'d, ExtFnProvider: 'd + ?Sized> CmdRecord<'d, ExtFnProvider>

Graphics/Compute Commands: Pipeline Setup

Source

pub fn bind_pipeline( self, bind_point: PipelineBindPoint, pipeline: &(impl VkHandle<Handle = VkPipeline> + ?Sized), ) -> Self

Bind a pipeline object to a command buffer

Source

pub fn bind_descriptor_sets( self, bind_point: PipelineBindPoint, pipeline_layout: &(impl VkHandle<Handle = VkPipelineLayout> + ?Sized), first: u32, descriptor_sets: &[DescriptorSet], dynamic_offsets: &[u32], ) -> Self

Binds descriptor sets to a command buffer

Source

pub fn push_constant<T>( self, pipeline_layout: &(impl VkHandle<Handle = VkPipelineLayout> + ?Sized), stage: VkShaderStageFlags, offset: u32, value: &T, ) -> Self

Update the value of push constant

Source

pub fn push_constant_slice<T>( self, pipeline_layout: &(impl VkHandle<Handle = VkPipelineLayout> + ?Sized), stage: VkShaderStageFlags, offset: u32, values: &[T], ) -> Self

Update the values of push constant

Source

pub unsafe fn push_descriptor_set_raw( self, bind_point: PipelineBindPoint, pipeline_layout: &(impl VkHandle<Handle = VkPipelineLayout> + ?Sized), set: u32, writes: &[VkWriteDescriptorSet], ) -> Self

Available on crate feature Allow1_4APIs only.

Push descriptor updates into a command buffer

Source

pub fn push_descriptor_set_alloc( self, bind_point: PipelineBindPoint, pipeline_layout: &(impl VkHandle<Handle = VkPipelineLayout> + ?Sized), set: u32, writes: &[DescriptorSetWriteInfo<'_>], ) -> Self

Available on crate features Allow1_4APIs and alloc only.

Push descriptor updates into a command buffer

Source§

impl<'d, ExtFnProvider: 'd + ?Sized> CmdRecord<'d, ExtFnProvider>

Graphics Commands: Updating dynamic states

Source

pub fn set_viewport(self, first: u32, viewports: &[Viewport]) -> Self

Set the viewport on a command buffer

Source

pub fn set_scissor(self, first: u32, scissors: &[Rect2D]) -> Self

Set the dynamic scissor rectangles on a command buffer

Source

pub fn set_line_width(self, w: f32) -> Self

Set the dynamic line width state

Source

pub fn set_depth_bias( self, constant_factor: f32, clamp: f32, slope_factor: f32, ) -> Self

Set the depth bias dynamic state

Source

pub fn set_blend_constants(self, blend_constants: &[f32; 4]) -> Self

Set the values of blend constants

Source

pub fn set_depth_bounds(self, bounds: Range<f32>) -> Self

Set the depth bounds test values for a command buffer

Source

pub fn set_stencil_compare_mask( self, face_mask: StencilFaceMask, compare_mask: u32, ) -> Self

Set the stencil compare mask dynamic state

Source

pub fn set_stencil_write_mask( self, face_mask: StencilFaceMask, write_mask: u32, ) -> Self

Set the stencil write mask dynamic state

Source

pub fn set_stencil_reference( self, face_mask: StencilFaceMask, reference: u32, ) -> Self

Set the stencil reference dynamic state

Source

pub fn set_sample_locations(self, info: &VkSampleLocationsInfoEXT) -> Self
where ExtFnProvider: DeviceExtCommandFunctionProvider,

Available on crate feature VK_EXT_sample_locations only.

Set the sample locations state

Source§

impl<'d, ExtFnProvider: 'd + ?Sized> CmdRecord<'d, ExtFnProvider>

Graphics Commands: Binding Buffers

Source

pub fn bind_index_buffer( self, buffer: &(impl VkHandle<Handle = VkBuffer> + ?Sized), offset: usize, index_type: IndexType, ) -> Self

Bind an index buffer to a command buffer

Source

pub fn bind_vertex_buffers( self, first: u32, buffers: &[VkHandleRef<'_, VkBuffer>], offsets: &[DeviceSize], ) -> Self

Bind vertex buffers to a command buffer

Source

pub fn bind_vertex_buffer_array<const N: usize>( self, first: u32, buffers: &[VkHandleRef<'_, VkBuffer>; N], offsets: &[DeviceSize; N], ) -> Self

Bind vertex buffers to a command buffer

Source§

impl<'d, ExtFnProvider: 'd + ?Sized> CmdRecord<'d, ExtFnProvider>

Graphics Commands: Inside a Render Pass

Source

pub fn draw( self, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32, ) -> Self

Draw primitives

Source

pub fn draw_indexed( self, index_count: u32, instance_count: u32, first_index: u32, vertex_offset: i32, first_instance: u32, ) -> Self

Issue an indexed draw into a command buffer

Source

pub fn draw_indirect( self, buffer: &(impl VkHandle<Handle = VkBuffer> + ?Sized), offset: DeviceSize, draw_count: u32, stride: u32, ) -> Self

Issue an indirect draw into a command buffer

Source

pub fn draw_indexed_indirect( self, buffer: &(impl VkHandle<Handle = VkBuffer> + ?Sized), offset: DeviceSize, draw_count: u32, stride: u32, ) -> Self

Perform an indexed indirect draw

Source§

impl<'d, ExtFnProvider: 'd + ?Sized> CmdRecord<'d, ExtFnProvider>

Compute Commands: Dispatching kernels

Source

pub fn dispatch( self, group_count_x: u32, group_count_y: u32, group_count_z: u32, ) -> Self

Dispatch compute work items

Source

pub fn dispatch_indirect( self, buffer: &(impl VkHandle<Handle = VkBuffer> + ?Sized), offset: DeviceSize, ) -> Self

Dispatch compute work items using indirect parameters

Source§

impl<'d, ExtFnProvider: 'd + ?Sized> CmdRecord<'d, ExtFnProvider>

Transfer Commands: Copying resources

Source

pub fn copy_buffer( self, src: &(impl VkHandle<Handle = VkBuffer> + ?Sized), dst: &(impl VkHandle<Handle = VkBuffer> + ?Sized), regions: &[BufferCopy], ) -> Self

Copy data between buffer regions

Source

pub fn copy_image( self, src: &(impl VkHandle<Handle = VkImage> + ?Sized), src_layout: ImageLayout, dst: &(impl VkHandle<Handle = VkImage> + ?Sized), dst_layout: ImageLayout, regions: &[ImageCopy], ) -> Self

Copy data between images

Source

pub fn blit_image( self, src: &(impl VkHandle<Handle = VkImage> + ?Sized), src_layout: ImageLayout, dst: &(impl VkHandle<Handle = VkImage> + ?Sized), dst_layout: ImageLayout, regions: &[VkImageBlit], filter: FilterMode, ) -> Self

Copy regions of an image, potentially performing format conversion

Source

pub fn copy_buffer_to_image( self, src_buffer: &(impl VkHandle<Handle = VkBuffer> + ?Sized), dst_image: &(impl VkHandle<Handle = VkImage> + ?Sized), dst_layout: ImageLayout, regions: &[VkBufferImageCopy], ) -> Self

Copy data from a buffer into an image

Source

pub fn copy_image_to_buffer( self, src_image: &(impl VkHandle<Handle = VkImage> + ?Sized), src_layout: ImageLayout, dst_buffer: &(impl VkHandle<Handle = VkBuffer> + ?Sized), regions: &[VkBufferImageCopy], ) -> Self

Copy image data into a buffer

Source

pub fn update_buffer<T>( self, dst: &(impl VkHandle<Handle = VkBuffer> + ?Sized), dst_offset: DeviceSize, size: DeviceSize, data: &T, ) -> Self

Update a buffer’s contents from host memory

Source§

impl<'d, ExtFnProvider: 'd + ?Sized> CmdRecord<'d, ExtFnProvider>

Graphics/Compute Commands: Transfer-like(clearing/filling) commands

Source

pub fn fill_buffer( self, dst: &(impl VkHandle<Handle = VkBuffer> + ?Sized), dst_offset: DeviceSize, size: DeviceSize, data: u32, ) -> Self

Fill a region of a buffer with a fixed value. size is number of bytes to fill

Source

pub fn clear_color_image( self, image: &(impl VkHandle<Handle = VkImage> + ?Sized), layout: ImageLayout, colors: &[ClearColorValue], ranges: &[VkImageSubresourceRange], ) -> Self

Clear regions of a color image

Source

pub fn clear_depth_stencil_image( self, image: &(impl VkHandle<Handle = VkImage> + ?Sized), layout: ImageLayout, depth: f32, stencil: u32, ranges: &[VkImageSubresourceRange], ) -> Self

Fill regions of a combined depth/stencil image

Source

pub fn clear_attachments( self, attachments: &[VkClearAttachment], rects: &[VkClearRect], ) -> Self

Clear regions within currently bound framebuffer attachments

Source§

impl<'d, ExtFnProvider: 'd + ?Sized> CmdRecord<'d, ExtFnProvider>

Graphics Commands: Executing Subcommands

Source

pub unsafe fn execute_commands( self, buffers: &[VkHandleRef<'_, VkCommandBuffer>], ) -> Self

Execute a secondary command buffer from a primary command buffer

§Safety

Caller must be primary buffer and in the render pass when executing secondary command buffer

Source§

impl<'d, ExtFnProvider: 'd + ?Sized> CmdRecord<'d, ExtFnProvider>

Graphics Commands: Resolving an image to another image

Source

pub fn resolve_image( self, src: &(impl VkHandle<Handle = VkImage> + ?Sized), src_layout: ImageLayout, dst: &(impl VkHandle<Handle = VkImage> + ?Sized), dst_layout: ImageLayout, regions: &[VkImageResolve], ) -> Self

Resolve regions of an image

Source§

impl<'d, ExtFnProvider: 'd + ?Sized> CmdRecord<'d, ExtFnProvider>

Graphics/Compute Commands: Synchronization between command buffers/queues

Source

pub fn set_event( self, event: &(impl VkHandle<Handle = VkEvent> + ?Sized), stage_mask: PipelineStageFlags, ) -> Self

Set an event object to signaled state

Source

pub fn reset_event( self, event: &(impl VkHandle<Handle = VkEvent> + ?Sized), stage_mask: PipelineStageFlags, ) -> Self

Reset an event object to non-signaled state

Source

pub fn wait_events( self, events: &[VkHandleRef<'_, VkEvent>], src_stage_mask: PipelineStageFlags, dst_stage_mask: PipelineStageFlags, memory_barriers: &[VkMemoryBarrier], buffer_memory_barriers: &[BufferMemoryBarrier], image_memory_barriers: &[ImageMemoryBarrier], ) -> Self

Wait for one or more events and insert a set of memory

Source

pub fn pipeline_barrier( self, src_stage_mask: PipelineStageFlags, dst_stage_mask: PipelineStageFlags, dependency_flags: VkDependencyFlags, memory_barriers: &[VkMemoryBarrier], buffer_memory_barriers: &[BufferMemoryBarrier], image_memory_barriers: &[ImageMemoryBarrier], ) -> Self

Insert a memory dependency

Source

pub fn pipeline_barrier_2( self, dependency_info: &DependencyInfo<'_, '_>, ) -> Self

Available on crate feature Allow1_3APIs only.

Insert a memory dependency

Source§

impl<'d, ExtFnProvider: 'd + ?Sized> CmdRecord<'d, ExtFnProvider>

Graphics/Compute Commands: Querying

Source

pub fn begin_query( self, pool: &(impl VkHandle<Handle = VkQueryPool> + ?Sized), query: u32, flags: VkQueryControlFlags, ) -> Self

Begin a query

Source

pub fn end_query( self, pool: &(impl VkHandle<Handle = VkQueryPool> + ?Sized), query: u32, ) -> Self

Ends a query

Source

pub fn reset_query_pool( self, pool: &(impl VkHandle<Handle = VkQueryPool> + ?Sized), range: Range<u32>, ) -> Self

Reset queries in a query pool

Source

pub fn write_timestamp( self, stage: PipelineStageFlags, pool: &(impl VkHandle<Handle = VkQueryPool> + ?Sized), query: u32, ) -> Self

Write a device timestamp into a query object

Source

pub fn copy_query_pool_results( self, pool: &(impl VkHandle<Handle = VkQueryPool> + ?Sized), range: Range<u32>, dst: &(impl VkHandle<Handle = VkBuffer> + ?Sized), dst_offset: DeviceSize, stride: DeviceSize, flags: QueryResultFlags, ) -> Self

Copy the results of queries in a query pool to a buffer object

Source§

impl<'d, ExtFnProvider: 'd + ?Sized> CmdRecord<'d, ExtFnProvider>

Graphics/Compute Commands: Miscellaneous

Source

pub fn inject(self, op: impl FnOnce(Self) -> Self) -> Self

Inject imperative command generation in method-chaining

Auto Trait Implementations§

§

impl<'d, ExtFnProvider> Freeze for CmdRecord<'d, ExtFnProvider>
where ExtFnProvider: ?Sized,

§

impl<'d, ExtFnProvider> !RefUnwindSafe for CmdRecord<'d, ExtFnProvider>

§

impl<'d, ExtFnProvider> !Send for CmdRecord<'d, ExtFnProvider>

§

impl<'d, ExtFnProvider> !Sync for CmdRecord<'d, ExtFnProvider>

§

impl<'d, ExtFnProvider> Unpin for CmdRecord<'d, ExtFnProvider>
where ExtFnProvider: ?Sized,

§

impl<'d, ExtFnProvider> !UnwindSafe for CmdRecord<'d, ExtFnProvider>

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.