Struct RecordingCommandBuffer

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

A command buffer in the recording state.

Unlike the raw RecordingCommandBuffer, this type has knowledge of the current task context and can therefore validate resource accesses. (TODO)

Implementations§

Source§

impl RecordingCommandBuffer<'_>

§Commands to bind or push state for pipeline execution commands

These commands require a queue with a pipeline type that uses the given state.

Source

pub unsafe fn bind_index_buffer( &mut self, buffer: Id<Buffer>, offset: DeviceSize, size: DeviceSize, index_type: IndexType, ) -> Result<&mut Self, Box<ValidationError>>

Binds an index buffer for future indexed draw calls.

Source

pub unsafe fn bind_index_buffer_unchecked( &mut self, buffer: Id<Buffer>, offset: DeviceSize, size: DeviceSize, index_type: IndexType, ) -> &mut Self

Source

pub unsafe fn bind_pipeline_compute( &mut self, pipeline: &Arc<ComputePipeline>, ) -> Result<&mut Self, Box<ValidationError>>

Binds a compute pipeline for future dispatch calls.

Source

pub unsafe fn bind_pipeline_compute_unchecked( &mut self, pipeline: &Arc<ComputePipeline>, ) -> &mut Self

Source

pub unsafe fn bind_pipeline_graphics( &mut self, pipeline: &Arc<GraphicsPipeline>, ) -> Result<&mut Self, Box<ValidationError>>

Binds a graphics pipeline for future draw calls.

Source

pub unsafe fn bind_pipeline_graphics_unchecked( &mut self, pipeline: &Arc<GraphicsPipeline>, ) -> &mut Self

Source

pub unsafe fn bind_pipeline_ray_tracing( &mut self, pipeline: &Arc<RayTracingPipeline>, ) -> Result<&mut Self, Box<ValidationError>>

Binds a ray tracing pipeline for future ray tracing calls.

Source

pub unsafe fn bind_pipeline_ray_tracing_unchecked( &mut self, pipeline: &Arc<RayTracingPipeline>, ) -> &mut Self

Source

pub unsafe fn bind_vertex_buffers( &mut self, first_binding: u32, buffers: &[Id<Buffer>], offsets: &[DeviceSize], sizes: &[DeviceSize], strides: &[DeviceSize], ) -> Result<&mut Self, Box<ValidationError>>

Binds vertex buffers for future draw calls.

Source

pub unsafe fn bind_vertex_buffers_unchecked( &mut self, first_binding: u32, buffers: &[Id<Buffer>], offsets: &[DeviceSize], sizes: &[DeviceSize], strides: &[DeviceSize], ) -> &mut Self

Source

pub unsafe fn push_constants( &mut self, layout: &Arc<PipelineLayout>, offset: u32, values: &(impl BufferContents + ?Sized), ) -> Result<&mut Self, Box<ValidationError>>

Sets push constants for future dispatch or draw calls.

Source

pub unsafe fn push_constants_unchecked( &mut self, layout: &Arc<PipelineLayout>, offset: u32, values: &(impl BufferContents + ?Sized), ) -> &mut Self

Source§

impl RecordingCommandBuffer<'_>

§Commands to fill resources with new data

Source

pub unsafe fn clear_color_image( &mut self, clear_info: &ClearColorImageInfo<'_>, ) -> Result<&mut Self, Box<ValidationError>>

Clears a color image with a specific value.

Source

pub unsafe fn clear_color_image_unchecked( &mut self, clear_info: &ClearColorImageInfo<'_>, ) -> &mut Self

Source

pub unsafe fn clear_depth_stencil_image( &mut self, clear_info: &ClearDepthStencilImageInfo<'_>, ) -> Result<&mut Self, Box<ValidationError>>

Clears a depth/stencil image with a specific value.

Source

pub unsafe fn clear_depth_stencil_image_unchecked( &mut self, clear_info: &ClearDepthStencilImageInfo<'_>, ) -> &mut Self

Source

pub unsafe fn fill_buffer( &mut self, fill_info: &FillBufferInfo<'_>, ) -> Result<&mut Self, Box<ValidationError>>

Fills a region of a buffer with repeated copies of a value.

This function is similar to the memset function in C. The data parameter is a number that will be repeatedly written through the entire buffer.

Source

pub unsafe fn fill_buffer_unchecked( &mut self, fill_info: &FillBufferInfo<'_>, ) -> &mut Self

Source

pub unsafe fn update_buffer( &mut self, dst_buffer: Id<Buffer>, dst_offset: DeviceSize, data: &(impl BufferContents + ?Sized), ) -> Result<&mut Self, Box<ValidationError>>

Writes data to a region of a buffer.

Source

pub unsafe fn update_buffer_unchecked( &mut self, dst_buffer: Id<Buffer>, dst_offset: DeviceSize, data: &(impl BufferContents + ?Sized), ) -> &mut Self

Source§

impl RecordingCommandBuffer<'_>

§Commands to transfer data between resources

Source

pub unsafe fn copy_buffer( &mut self, copy_buffer_info: &CopyBufferInfo<'_>, ) -> Result<&mut Self, Box<ValidationError>>

Copies data from a buffer to another buffer.

Source

pub unsafe fn copy_buffer_unchecked( &mut self, copy_buffer_info: &CopyBufferInfo<'_>, ) -> &mut Self

Source

pub unsafe fn copy_image( &mut self, copy_image_info: &CopyImageInfo<'_>, ) -> Result<&mut Self, Box<ValidationError>>

Copies data from an image to another image.

There are several restrictions:

  • The number of samples in the source and destination images must be equal.
  • The size of the uncompressed element format of the source image must be equal to the compressed element format of the destination.
  • If you copy between depth, stencil or depth-stencil images, the format of both images must match exactly.
  • For two-dimensional images, the Z coordinate must be 0 for the image offsets and 1 for the extent. Same for the Y coordinate for one-dimensional images.
  • For non-array images, the base array layer must be 0 and the number of layers must be 1.

If layer_count is greater than 1, the copy will happen between each individual layer as if they were separate images.

Source

pub unsafe fn copy_image_unchecked( &mut self, copy_image_info: &CopyImageInfo<'_>, ) -> &mut Self

Source

pub unsafe fn copy_buffer_to_image( &mut self, copy_buffer_to_image_info: &CopyBufferToImageInfo<'_>, ) -> Result<&mut Self, Box<ValidationError>>

Copies from a buffer to an image.

Source

pub unsafe fn copy_buffer_to_image_unchecked( &mut self, copy_buffer_to_image_info: &CopyBufferToImageInfo<'_>, ) -> &mut Self

Source

pub unsafe fn copy_image_to_buffer( &mut self, copy_image_to_buffer_info: &CopyImageToBufferInfo<'_>, ) -> Result<&mut Self, Box<ValidationError>>

Copies from an image to a buffer.

Source

pub unsafe fn copy_image_to_buffer_unchecked( &mut self, copy_image_to_buffer_info: &CopyImageToBufferInfo<'_>, ) -> &mut Self

Source

pub unsafe fn blit_image( &mut self, blit_image_info: &BlitImageInfo<'_>, ) -> Result<&mut Self, Box<ValidationError>>

Blits an image to another.

A blit is similar to an image copy operation, except that the portion of the image that is transferred can be resized. You choose an area of the source and an area of the destination, and the implementation will resize the area of the source so that it matches the size of the area of the destination before writing it.

Blit operations have several restrictions:

  • Blit operations are only allowed on queue families that support graphics operations.
  • The format of the source and destination images must support blit operations, which depends on the Vulkan implementation. Vulkan guarantees that some specific formats must always be supported. See tables 52 to 61 of the specifications.
  • Only single-sampled images are allowed.
  • You can only blit between two images whose formats belong to the same type. The types are: floating-point, signed integers, unsigned integers, depth-stencil.
  • If you blit between depth, stencil or depth-stencil images, the format of both images must match exactly.
  • If you blit between depth, stencil or depth-stencil images, only the Nearest filter is allowed.
  • For two-dimensional images, the Z coordinate must be 0 for the top-left offset and 1 for the bottom-right offset. Same for the Y coordinate for one-dimensional images.
  • For non-array images, the base array layer must be 0 and the number of layers must be 1.

If layer_count is greater than 1, the blit will happen between each individual layer as if they were separate images.

Source

pub unsafe fn blit_image_unchecked( &mut self, blit_image_info: &BlitImageInfo<'_>, ) -> &mut Self

Source

pub unsafe fn resolve_image( &mut self, resolve_image_info: &ResolveImageInfo<'_>, ) -> Result<&mut Self, Box<ValidationError>>

Resolves a multisampled image into a single-sampled image.

Source

pub unsafe fn resolve_image_unchecked( &mut self, resolve_image_info: &ResolveImageInfo<'_>, ) -> &mut Self

Source§

impl RecordingCommandBuffer<'_>

§Commands to set dynamic state for pipelines

These commands require a queue with a pipeline type that uses the given state.

Source

pub unsafe fn set_blend_constants( &mut self, constants: &[f32; 4], ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic blend constants for future draw calls.

Source

pub unsafe fn set_blend_constants_unchecked( &mut self, constants: &[f32; 4], ) -> &mut Self

Source

pub unsafe fn set_color_write_enable( &mut self, enables: &[bool], ) -> Result<&mut Self, Box<ValidationError>>

Sets whether dynamic color writes should be enabled for each attachment in the framebuffer.

Source

pub unsafe fn set_color_write_enable_unchecked( &mut self, enables: &[bool], ) -> &mut Self

Source

pub unsafe fn set_cull_mode( &mut self, cull_mode: CullMode, ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic cull mode for future draw calls.

Source

pub unsafe fn set_cull_mode_unchecked( &mut self, cull_mode: CullMode, ) -> &mut Self

Source

pub unsafe fn set_depth_bias( &mut self, constant_factor: f32, clamp: f32, slope_factor: f32, ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic depth bias values for future draw calls.

Source

pub unsafe fn set_depth_bias_unchecked( &mut self, constant_factor: f32, clamp: f32, slope_factor: f32, ) -> &mut Self

Source

pub unsafe fn set_depth_bias_enable( &mut self, enable: bool, ) -> Result<&mut Self, Box<ValidationError>>

Sets whether dynamic depth bias is enabled for future draw calls.

Source

pub unsafe fn set_depth_bias_enable_unchecked( &mut self, enable: bool, ) -> &mut Self

Source

pub unsafe fn set_depth_bounds( &mut self, bounds: RangeInclusive<f32>, ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic depth bounds for future draw calls.

Source

pub unsafe fn set_depth_bounds_unchecked( &mut self, bounds: RangeInclusive<f32>, ) -> &mut Self

Source

pub unsafe fn set_depth_bounds_test_enable( &mut self, enable: bool, ) -> Result<&mut Self, Box<ValidationError>>

Sets whether dynamic depth bounds testing is enabled for future draw calls.

Source

pub unsafe fn set_depth_bounds_test_enable_unchecked( &mut self, enable: bool, ) -> &mut Self

Source

pub unsafe fn set_depth_compare_op( &mut self, compare_op: CompareOp, ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic depth compare op for future draw calls.

Source

pub unsafe fn set_depth_compare_op_unchecked( &mut self, compare_op: CompareOp, ) -> &mut Self

Source

pub unsafe fn set_depth_test_enable( &mut self, enable: bool, ) -> Result<&mut Self, Box<ValidationError>>

Sets whether dynamic depth testing is enabled for future draw calls.

Source

pub unsafe fn set_depth_test_enable_unchecked( &mut self, enable: bool, ) -> &mut Self

Source

pub unsafe fn set_depth_write_enable( &mut self, enable: bool, ) -> Result<&mut Self, Box<ValidationError>>

Sets whether dynamic depth write is enabled for future draw calls.

Source

pub unsafe fn set_depth_write_enable_unchecked( &mut self, enable: bool, ) -> &mut Self

Source

pub unsafe fn set_discard_rectangle( &mut self, first_rectangle: u32, rectangles: &[Scissor], ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic discard rectangles for future draw calls.

Source

pub unsafe fn set_discard_rectangle_unchecked( &mut self, first_rectangle: u32, rectangles: &[Scissor], ) -> &mut Self

Source

pub unsafe fn set_front_face( &mut self, face: FrontFace, ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic front face for future draw calls.

Source

pub unsafe fn set_front_face_unchecked(&mut self, face: FrontFace) -> &mut Self

Source

pub unsafe fn set_line_stipple( &mut self, factor: u32, pattern: u16, ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic line stipple values for future draw calls.

Source

pub unsafe fn set_line_stipple_unchecked( &mut self, factor: u32, pattern: u16, ) -> &mut Self

Source

pub unsafe fn set_line_width( &mut self, line_width: f32, ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic line width for future draw calls.

Source

pub unsafe fn set_line_width_unchecked(&mut self, line_width: f32) -> &mut Self

Source

pub unsafe fn set_logic_op( &mut self, logic_op: LogicOp, ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic logic op for future draw calls.

Source

pub unsafe fn set_logic_op_unchecked(&mut self, logic_op: LogicOp) -> &mut Self

Source

pub unsafe fn set_patch_control_points( &mut self, num: u32, ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic number of patch control points for future draw calls.

Source

pub unsafe fn set_patch_control_points_unchecked( &mut self, num: u32, ) -> &mut Self

Source

pub unsafe fn set_primitive_restart_enable( &mut self, enable: bool, ) -> Result<&mut Self, Box<ValidationError>>

Sets whether dynamic primitive restart is enabled for future draw calls.

Source

pub unsafe fn set_primitive_restart_enable_unchecked( &mut self, enable: bool, ) -> &mut Self

Source

pub unsafe fn set_primitive_topology( &mut self, topology: PrimitiveTopology, ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic primitive topology for future draw calls.

Source

pub unsafe fn set_primitive_topology_unchecked( &mut self, topology: PrimitiveTopology, ) -> &mut Self

Source

pub unsafe fn set_rasterizer_discard_enable( &mut self, enable: bool, ) -> Result<&mut Self, Box<ValidationError>>

Sets whether dynamic rasterizer discard is enabled for future draw calls.

Source

pub unsafe fn set_rasterizer_discard_enable_unchecked( &mut self, enable: bool, ) -> &mut Self

Source

pub unsafe fn set_scissor( &mut self, first_scissor: u32, scissors: &[Scissor], ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic scissors for future draw calls.

Source

pub unsafe fn set_scissor_unchecked( &mut self, first_scissor: u32, scissors: &[Scissor], ) -> &mut Self

Source

pub unsafe fn set_scissor_with_count( &mut self, scissors: &[Scissor], ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic scissors with count for future draw calls.

Source

pub unsafe fn set_scissor_with_count_unchecked( &mut self, scissors: &[Scissor], ) -> &mut Self

Source

pub unsafe fn set_stencil_compare_mask( &mut self, faces: StencilFaces, compare_mask: u32, ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic stencil compare mask on one or both faces for future draw calls.

Source

pub unsafe fn set_stencil_compare_mask_unchecked( &mut self, faces: StencilFaces, compare_mask: u32, ) -> &mut Self

Source

pub unsafe fn set_stencil_op( &mut self, faces: StencilFaces, fail_op: StencilOp, pass_op: StencilOp, depth_fail_op: StencilOp, compare_op: CompareOp, ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic stencil ops on one or both faces for future draw calls.

Source

pub unsafe fn set_stencil_op_unchecked( &mut self, faces: StencilFaces, fail_op: StencilOp, pass_op: StencilOp, depth_fail_op: StencilOp, compare_op: CompareOp, ) -> &mut Self

Source

pub unsafe fn set_stencil_reference( &mut self, faces: StencilFaces, reference: u32, ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic stencil reference on one or both faces for future draw calls.

Source

pub unsafe fn set_stencil_reference_unchecked( &mut self, faces: StencilFaces, reference: u32, ) -> &mut Self

Source

pub unsafe fn set_stencil_test_enable( &mut self, enable: bool, ) -> Result<&mut Self, Box<ValidationError>>

Sets whether dynamic stencil testing is enabled for future draw calls.

Source

pub unsafe fn set_stencil_test_enable_unchecked( &mut self, enable: bool, ) -> &mut Self

Source

pub unsafe fn set_stencil_write_mask( &mut self, faces: StencilFaces, write_mask: u32, ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic stencil write mask on one or both faces for future draw calls.

Source

pub unsafe fn set_stencil_write_mask_unchecked( &mut self, faces: StencilFaces, write_mask: u32, ) -> &mut Self

Source

pub unsafe fn set_vertex_input( &mut self, vertex_input_state: &VertexInputState, ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic vertex input for future draw calls.

Source

pub unsafe fn set_vertex_input_unchecked( &mut self, vertex_input_state: &VertexInputState, ) -> &mut Self

Source

pub unsafe fn set_viewport( &mut self, first_viewport: u32, viewports: &[Viewport], ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic viewports for future draw calls.

Source

pub unsafe fn set_viewport_unchecked( &mut self, first_viewport: u32, viewports: &[Viewport], ) -> &mut Self

Source

pub unsafe fn set_viewport_with_count( &mut self, viewports: &[Viewport], ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic viewports with count for future draw calls.

Source

pub unsafe fn set_viewport_with_count_unchecked( &mut self, viewports: &[Viewport], ) -> &mut Self

Source

pub unsafe fn set_conservative_rasterization_mode( &mut self, conservative_rasterization_mode: ConservativeRasterizationMode, ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic conservative rasterization mode for future draw calls.

Source

pub unsafe fn set_conservative_rasterization_mode_unchecked( &mut self, conservative_rasterization_mode: ConservativeRasterizationMode, ) -> &mut Self

Source

pub unsafe fn set_extra_primitive_overestimation_size( &mut self, extra_primitive_overestimation_size: f32, ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic extra primitive overestimation size for future draw calls.

Source

pub unsafe fn set_extra_primitive_overestimation_size_unchecked( &mut self, extra_primitive_overestimation_size: f32, ) -> &mut Self

Source

pub unsafe fn set_fragment_shading_rate( &mut self, fragment_size: [u32; 2], combiner_ops: [FragmentShadingRateCombinerOp; 2], ) -> Result<&mut Self, Box<ValidationError>>

Sets the dynamic fragment shading rate for future draw calls.

Source

pub unsafe fn set_fragment_shading_rate_unchecked( &mut self, fragment_size: [u32; 2], combiner_ops: [FragmentShadingRateCombinerOp; 2], ) -> &mut Self

Source§

impl RecordingCommandBuffer<'_>

§Commands to execute a bound pipeline

Dispatch commands require a compute queue, draw commands require a graphics queue.

Source

pub unsafe fn dispatch( &mut self, group_counts: [u32; 3], ) -> Result<&mut Self, Box<ValidationError>>

Performs a single compute operation using a compute pipeline.

A compute pipeline must have been bound using bind_pipeline_compute. Any resources used by the compute pipeline, such as descriptor sets, must have been set beforehand.

§Safety
Source

pub unsafe fn dispatch_unchecked(&mut self, group_counts: [u32; 3]) -> &mut Self

Source

pub unsafe fn dispatch_indirect( &mut self, buffer: Id<Buffer>, offset: DeviceSize, ) -> Result<&mut Self, Box<ValidationError>>

Performs a single compute operation using a compute pipeline. One dispatch is performed for the DispatchIndirectCommand struct that is read from buffer starting at offset.

A compute pipeline must have been bound using bind_pipeline_compute. Any resources used by the compute pipeline, such as descriptor sets, must have been set beforehand.

§Safety
Source

pub unsafe fn dispatch_indirect_unchecked( &mut self, buffer: Id<Buffer>, offset: DeviceSize, ) -> &mut Self

Source

pub unsafe fn draw( &mut self, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32, ) -> Result<&mut Self, Box<ValidationError>>

Performs a single draw operation using a primitive shading graphics pipeline.

The parameters specify the first vertex and the number of vertices to draw, and the first instance and number of instances. For non-instanced drawing, specify instance_count as 1 and first_instance as 0.

A primitive shading graphics pipeline must have been bound using bind_pipeline_graphics. Any resources used by the graphics pipeline, such as descriptor sets, vertex buffers and dynamic state, must have been set beforehand. If the bound graphics pipeline uses vertex buffers, then the provided vertex and instance ranges must be in range of the bound vertex buffers.

§Safety
Source

pub unsafe fn draw_unchecked( &mut self, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32, ) -> &mut Self

Source

pub unsafe fn draw_indirect( &mut self, buffer: Id<Buffer>, offset: DeviceSize, draw_count: u32, stride: u32, ) -> Result<&mut Self, Box<ValidationError>>

Performs multiple draw operations using a primitive shading graphics pipeline.

One draw is performed for each DrawIndirectCommand struct that is read from buffer starting at offset, with the offset increasing by stride bytes for each successive draw. draw_count draw commands are performed. The maximum number of draw commands in the buffer is limited by the max_draw_indirect_count limit. This limit is 1 unless the multi_draw_indirect feature has been enabled.

A primitive shading graphics pipeline must have been bound using bind_pipeline_graphics. Any resources used by the graphics pipeline, such as descriptor sets, vertex buffers and dynamic state, must have been set beforehand. If the bound graphics pipeline uses vertex buffers, then the vertex and instance ranges of each DrawIndirectCommand in the indirect buffer must be in range of the bound vertex buffers.

§Safety
Source

pub unsafe fn draw_indirect_unchecked( &mut self, buffer: Id<Buffer>, offset: DeviceSize, draw_count: u32, stride: u32, ) -> &mut Self

Source

pub unsafe fn draw_indirect_count( &mut self, buffer: Id<Buffer>, offset: DeviceSize, count_buffer: Id<Buffer>, count_buffer_offset: DeviceSize, max_draw_count: u32, stride: u32, ) -> Result<&mut Self, Box<ValidationError>>

Performs multiple draw operations using a primitive shading graphics pipeline, reading the number of draw operations from a separate buffer.

One draw is performed for each DrawIndirectCommand struct that is read from buffer starting at offset, with the offset increasing by stride bytes for each successive draw. The number of draws to perform is read from count_buffer at count_buffer_offset, or specified by max_draw_count, whichever is lower. This number is limited by the max_draw_indirect_count limit.

A primitive shading graphics pipeline must have been bound using bind_pipeline_graphics. Any resources used by the graphics pipeline, such as descriptor sets, vertex buffers and dynamic state, must have been set beforehand. If the bound graphics pipeline uses vertex buffers, then the vertex and instance ranges of each DrawIndirectCommand in the indirect buffer must be in range of the bound vertex buffers.

§Safety
Source

pub unsafe fn draw_indirect_count_unchecked( &mut self, buffer: Id<Buffer>, offset: DeviceSize, count_buffer: Id<Buffer>, count_buffer_offset: DeviceSize, max_draw_count: u32, stride: u32, ) -> &mut Self

Source

pub unsafe fn draw_indexed( &mut self, index_count: u32, instance_count: u32, first_index: u32, vertex_offset: i32, first_instance: u32, ) -> Result<&mut Self, Box<ValidationError>>

Performs a single draw operation using a primitive shading graphics pipeline, using an index buffer.

The parameters specify the first index and the number of indices in the index buffer that should be used, and the first instance and number of instances. For non-instanced drawing, specify instance_count as 1 and first_instance as 0. The vertex_offset is a constant value that should be added to each index in the index buffer to produce the final vertex number to be used.

An index buffer must have been bound using bind_index_buffer, and the provided index range must be in range of the bound index buffer.

A primitive shading graphics pipeline must have been bound using bind_pipeline_graphics. Any resources used by the graphics pipeline, such as descriptor sets, vertex buffers and dynamic state, must have been set beforehand. If the bound graphics pipeline uses vertex buffers, then the provided instance range must be in range of the bound vertex buffers. The vertex indices in the index buffer must be in range of the bound vertex buffers.

§Safety
  • The general shader safety requirements apply.
  • Every vertex number that is retrieved from the index buffer must fall within the range of the bound vertex-rate vertex buffers.
  • Every vertex number that is retrieved from the index buffer, if it is not the special primitive restart value, must be no greater than the max_draw_indexed_index_value device limit.
Source

pub unsafe fn draw_indexed_unchecked( &mut self, index_count: u32, instance_count: u32, first_index: u32, vertex_offset: i32, first_instance: u32, ) -> &mut Self

Source

pub unsafe fn draw_indexed_indirect( &mut self, buffer: Id<Buffer>, offset: DeviceSize, draw_count: u32, stride: u32, ) -> Result<&mut Self, Box<ValidationError>>

Performs multiple draw operations using a primitive shading graphics pipeline, using an index buffer.

One draw is performed for each DrawIndexedIndirectCommand struct that is read from buffer starting at offset, with the offset increasing by stride bytes with each successive draw. draw_count draw commands are performed. The maximum number of draw commands in the buffer is limited by the max_draw_indirect_count limit. This limit is 1 unless the multi_draw_indirect feature has been enabled.

An index buffer must have been bound using bind_index_buffer, and the index ranges of each DrawIndexedIndirectCommand in the indirect buffer must be in range of the bound index buffer.

A primitive shading graphics pipeline must have been bound using bind_pipeline_graphics. Any resources used by the graphics pipeline, such as descriptor sets, vertex buffers and dynamic state, must have been set beforehand. If the bound graphics pipeline uses vertex buffers, then the instance ranges of each DrawIndexedIndirectCommand in the indirect buffer must be in range of the bound vertex buffers.

§Safety
Source

pub unsafe fn draw_indexed_indirect_unchecked( &mut self, buffer: Id<Buffer>, offset: DeviceSize, draw_count: u32, stride: u32, ) -> &mut Self

Source

pub unsafe fn draw_indexed_indirect_count( &mut self, buffer: Id<Buffer>, offset: DeviceSize, count_buffer: Id<Buffer>, count_buffer_offset: DeviceSize, max_draw_count: u32, stride: u32, ) -> Result<&mut Self, Box<ValidationError>>

Performs multiple draw operations using a primitive shading graphics pipeline, using an index buffer, and reading the number of draw operations from a separate buffer.

One draw is performed for each DrawIndexedIndirectCommand struct that is read from buffer starting at offset, with the offset increasing by stride bytes for each successive draw. The number of draws to perform is read from count_buffer at count_buffer_offset, or specified by max_draw_count, whichever is lower. This number is limited by the max_draw_indirect_count limit.

An index buffer must have been bound using bind_index_buffer, and the index ranges of each DrawIndexedIndirectCommand in the indirect buffer must be in range of the bound index buffer.

A primitive shading graphics pipeline must have been bound using bind_pipeline_graphics. Any resources used by the graphics pipeline, such as descriptor sets, vertex buffers and dynamic state, must have been set beforehand. If the bound graphics pipeline uses vertex buffers, then the instance ranges of each DrawIndexedIndirectCommand in the indirect buffer must be in range of the bound vertex buffers.

§Safety
Source

pub unsafe fn draw_indexed_indirect_count_unchecked( &mut self, buffer: Id<Buffer>, offset: DeviceSize, count_buffer: Id<Buffer>, count_buffer_offset: DeviceSize, max_draw_count: u32, stride: u32, ) -> &mut Self

Source

pub unsafe fn draw_mesh_tasks( &mut self, group_counts: [u32; 3], ) -> Result<&mut Self, Box<ValidationError>>

Perform a single draw operation using a mesh shading graphics pipeline.

A mesh shading graphics pipeline must have been bound using bind_pipeline_graphics. Any resources used by the graphics pipeline, such as descriptor sets and dynamic state, must have been set beforehand.

§Safety
Source

pub unsafe fn draw_mesh_tasks_unchecked( &mut self, group_counts: [u32; 3], ) -> &mut Self

Source

pub unsafe fn draw_mesh_tasks_indirect( &mut self, buffer: Id<Buffer>, offset: DeviceSize, draw_count: u32, stride: u32, ) -> Result<&mut Self, Box<ValidationError>>

Perform multiple draw operations using a mesh shading graphics pipeline.

One draw is performed for each DrawMeshTasksIndirectCommand struct that is read from buffer starting at offset, with the offset increasing by stride bytes for each successive draw. draw_count draw commands are performed. The maximum number of draw commands in the buffer is limited by the max_draw_indirect_count limit. This limit is 1 unless the multi_draw_indirect feature has been enabled.

A mesh shading graphics pipeline must have been bound using bind_pipeline_graphics. Any resources used by the graphics pipeline, such as descriptor sets and dynamic state, must have been set beforehand.

§Safety
Source

pub unsafe fn draw_mesh_tasks_indirect_unchecked( &mut self, buffer: Id<Buffer>, offset: DeviceSize, draw_count: u32, stride: u32, ) -> &mut Self

Source

pub unsafe fn draw_mesh_tasks_indirect_count( &mut self, buffer: Id<Buffer>, offset: DeviceSize, count_buffer: Id<Buffer>, count_buffer_offset: DeviceSize, max_draw_count: u32, stride: u32, ) -> Result<&mut Self, Box<ValidationError>>

Performs multiple draw operations using a mesh shading graphics pipeline, reading the number of draw operations from a separate buffer.

One draw is performed for each DrawMeshTasksIndirectCommand struct that is read from buffer starting at offset, with the offset increasing by stride bytes after each successive draw. The number of draws to perform is read from count_buffer, or specified by max_draw_count, whichever is lower. This number is limited by the max_draw_indirect_count limit.

A mesh shading graphics pipeline must have been bound using bind_pipeline_graphics. Any resources used by the graphics pipeline, such as descriptor sets and dynamic state, must have been set beforehand.

§Safety
Source

pub unsafe fn draw_mesh_tasks_indirect_count_unchecked( &mut self, buffer: Id<Buffer>, offset: DeviceSize, count_buffer: Id<Buffer>, count_buffer_offset: DeviceSize, max_draw_count: u32, stride: u32, ) -> &mut Self

Source

pub unsafe fn trace_rays( &mut self, shader_binding_table_addresses: &ShaderBindingTableAddresses, dimensions: [u32; 3], ) -> Result<&mut Self, Box<ValidationError>>

Performs a single ray tracing operation using a ray tracing pipeline.

A ray tracing pipeline must have been bound using bind_pipeline_ray_tracing. Any resources used by the ray tracing pipeline, such as descriptor sets, must have been set beforehand.

§Safety
Source

pub unsafe fn trace_rays_unchecked( &mut self, shader_binding_table_addresses: &ShaderBindingTableAddresses, dimensions: [u32; 3], ) -> &mut Self

Source§

impl RecordingCommandBuffer<'_>

§Commands for render passes

These commands require a graphics queue.

Source

pub unsafe fn clear_attachments( &mut self, attachments: &[ClearAttachment], rects: &[ClearRect], ) -> Result<&mut Self, Box<ValidationError>>

Clears specific regions of specific attachments of the framebuffer.

attachments specify the types of attachments and their clear values. rects specify the regions to clear.

If the render pass instance this is recorded in uses multiview then [ClearRect::base_array_layer] must be zero and [ClearRect::layer_count] must be one.

The rectangle area must be inside the render area ranges.

Source

pub unsafe fn clear_attachments_unchecked( &mut self, attachments: &[ClearAttachment], rects: &[ClearRect], ) -> &mut Self

Source§

impl RecordingCommandBuffer<'_>

§Commands to synchronize resource accesses

Source

pub unsafe fn pipeline_barrier( &mut self, dependency_info: &DependencyInfo<'_>, ) -> Result<&mut Self, Box<ValidationError>>

Source

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

Source§

impl<'a> RecordingCommandBuffer<'a>

Source

pub fn as_raw(&mut self) -> &mut RecordingCommandBuffer

Returns the underlying raw command buffer.

While this method is safe, using the command buffer isn’t. You must guarantee that any subresources you use while recording commands are either accounted for in the [task’s access set], or that those subresources don’t require any synchronization (including layout transitions and queue family ownership transfers), or that no other task is accessing the subresources at the same time without appropriate synchronization.

Source

pub fn destroy_object(&mut self, object: Arc<impl Any + Send + Sync>)

Queues the destruction of the given object after the destruction of the command buffer.

Source

pub fn destroy_objects( &mut self, objects: impl IntoIterator<Item = Arc<impl Any + Send + Sync>>, )

Queues the destruction of the given objects after the destruction of the command buffer.

Trait Implementations§

Source§

impl DeviceOwned for RecordingCommandBuffer<'_>

Source§

fn device(&self) -> &Arc<Device>

Returns the device that owns self.
Source§

impl VulkanObject for RecordingCommandBuffer<'_>

Source§

type Handle = CommandBuffer

The type of the object.
Source§

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

Returns the raw Vulkan handle of the object.

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<T> DeviceOwnedVulkanObject for T

Source§

fn set_debug_utils_object_name( &self, object_name: Option<&str>, ) -> Result<(), VulkanError>

Assigns a human-readable name to the object for debugging purposes. 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.