Skip to main content

CommandRecording

Struct CommandRecording 

Source
pub struct CommandRecording<'a> { /* private fields */ }
Expand description

An in-progress command buffer recording, outside of a render pass.

Implementations§

Source§

impl<'a> CommandRecording<'a>

Source

pub fn fill_buffer( &mut self, dst: &Arc<Buffer>, offset: u64, size: Option<u64>, data: u32, ) -> Result<()>

The reference count of dst is incremented. Offset and size are rounded down to the nearest multiple of 4. Returns Error::OutOfBounds if they are out of bounds. (see vkCmdFillBuffer)

Source

pub fn copy_buffer( &mut self, src: &Arc<Buffer>, dst: &Arc<Buffer>, regions: &[BufferCopy], ) -> Result<()>

The reference counts of src and dst are incremented. Returns Error::OutOfBounds if a region is out of bounds. (see vkCmdCopyBuffer)

Source

pub fn copy_buffer_to_image( &mut self, src: &Arc<Buffer>, dst: &Arc<Image>, dst_layout: ImageLayout, regions: &[BufferImageCopy], ) -> Result<()>

The reference counts of src and dst are incremented. Returns Error::OutOfBounds if a region is out of bounds. Returns Error::InvalidArgument if regions is empty. (see vkCmdCopyBufferToImage)

Source

pub fn blit_image( &mut self, src: &Arc<Image>, src_layout: ImageLayout, dst: &Arc<Image>, dst_layout: ImageLayout, regions: &[ImageBlit], filter: Filter, ) -> Result<()>

The reference counts of src and dst are incremented. Returns Error::OutOfBounds if a region is out of bounds. Returns Error::InvalidArgument if regions is empty. (see vkCmdBlitImage)

Source

pub fn clear_color_image( &mut self, image: &Arc<Image>, layout: ImageLayout, color: ClearColorValue, ranges: &[ImageSubresourceRange], ) -> Result<()>

The reference count of image is incremented. Returns Error::InvalidArgument if ranges is empty. (see vkCmdClearColorImage)

Source§

impl<'a> CommandRecording<'a>

Source

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

Source

pub fn memory_barrier( &mut self, src_stage_mask: PipelineStageFlags, dst_stage_mask: PipelineStageFlags, src_access_mask: AccessFlags, dst_access_mask: AccessFlags, )

A shortcut for simple memory barriers. (see vkCmdPipelineBarrier)

Source

pub fn image_barrier( &mut self, image: &Arc<Image>, src_stage_mask: PipelineStageFlags, dst_stage_mask: PipelineStageFlags, src_access_mask: AccessFlags, dst_access_mask: AccessFlags, old_layout: ImageLayout, new_layout: ImageLayout, )

A shortcut for simple image barriers. (see vkCmdPipelineBarrier)

Source§

impl<'a> CommandRecording<'a>

Source

pub fn bind_pipeline(&mut self, pipeline: &Arc<Pipeline>)

Binds the pipeline to the appropriate bind point. The reference count of pipeline is incremented. (see vkCmdBindPipeline)

Source§

impl<'a> CommandRecording<'a>

Source

pub fn bind_vertex_buffers( &mut self, first_binding: u32, buffers_offsets: &[(&Arc<Buffer>, u64)], ) -> Result<()>

Reference counts of buffers are incremented. Returns Error::InvalidArgument if buffers_offsets is empty or the buffer usage flags don’t include VERTEX_BUFFER. (see vkCmdBindVertexBuffers)

Source

pub fn bind_index_buffer( &mut self, buffer: &Arc<Buffer>, offset: u64, index_type: IndexType, ) -> Result<()>

Reference count of buffer is incremented. Returns Error::InvalidArgument if buffer does not have the INDEX_BUFFER usage flag. (see vkCmdBindIndexBuffer)

Source§

impl<'a> CommandRecording<'a>

Source

pub fn bind_descriptor_sets( &mut self, pipeline_bind_point: PipelineBindPoint, layout: &PipelineLayout, first_set: u32, sets: &[&Arc<DescriptorSet>], dynamic_offsets: &[u32], ) -> Result<()>

Returns Error::InvalidArgument if a member of sets is not compatible with the corresponding member of layout, if the length of dynamic_offsets is not correct for layout, or if any binding in any of sets is not initialized.

If the value of the binding will not be used, create a dummy object of the appropriate type and bind it.

The reference count of each member of sets is incremented.

(see vkCmdBindDescriptorSets)

Source§

impl<'a> CommandRecording<'a>

Source

pub fn push_constants( &mut self, layout: &PipelineLayout, stage_flags: ShaderStageFlags, offset: u32, data: &[u8], ) -> Result<()>

Sets push constants. Returns Error::OutOfBounds if the data is out of bounds for push contants in layout or if stage_flags is incorrect. Returns Error::InvalidArgument if data is empty. (see vkCmdPushConstants)

Source§

impl<'a> CommandRecording<'a>

Source

pub fn set_viewport(&mut self, viewport: &Viewport)

Source§

impl<'a> CommandRecording<'a>

Source

pub fn set_scissor(&mut self, scissor: &Rect2D)

Source§

impl<'a> CommandRecording<'a>

Source

pub fn dispatch( &mut self, group_count_x: u32, group_count_y: u32, group_count_z: u32, ) -> Result<()>

Source

pub fn dispatch_indirect( &mut self, buffer: &Arc<Buffer>, offset: u64, ) -> Result<()>

Source§

impl<'a> CommandRecording<'a>

Source

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

A failed call to vkEndCommandBuffer leaves the buffer in the invalid state, so it is dropped in that case. (see vkEndCommandBuffer)

Source§

impl<'a> CommandRecording<'a>

Source

pub fn begin_render_pass( self, render_pass: &Arc<RenderPass>, framebuffer: &Arc<Framebuffer>, render_area: &Rect2D, clear_values: &[ClearValue], ) -> Result<RenderPassRecording<'a>>

Begins a render pass recorded inline. Returns Error::InvalidArgument if framebuffer and render_pass are not compatible. (see vkCmdBeginRenderPass)

Source

pub fn begin_render_pass_secondary( self, render_pass: &Arc<RenderPass>, framebuffer: &Arc<Framebuffer>, render_area: &Rect2D, clear_values: &[ClearValue], ) -> Result<ExternalRenderPassRecording<'a>>

Begins a render pass recorded in secondary command buffers. Returns Error::InvalidArgument if framebuffer and render_pass are not compatible. (see vkCmdBeginRenderPass)

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for CommandRecording<'a>

§

impl<'a> !Send for CommandRecording<'a>

§

impl<'a> !Sync for CommandRecording<'a>

§

impl<'a> !UnwindSafe for CommandRecording<'a>

§

impl<'a> Freeze for CommandRecording<'a>

§

impl<'a> Unpin for CommandRecording<'a>

§

impl<'a> UnsafeUnpin for CommandRecording<'a>

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.