pub struct CommandBuffer { /* private fields */ }Implementations§
Source§impl CommandBuffer
impl CommandBuffer
Sourcepub fn new(
command_pool: Arc<CommandPool>,
level: CommandBufferLevel,
) -> VkResult<Self>
pub fn new( command_pool: Arc<CommandPool>, level: CommandBufferLevel, ) -> VkResult<Self>
Allocates a single command buffer. To allocate multiple at a time, use CommandPool::allocate_command_buffers.
Sourcepub fn reset(&self, reset_flags: CommandBufferResetFlags) -> VkResult<()>
pub fn reset(&self, reset_flags: CommandBufferResetFlags) -> VkResult<()>
Note: this will fail if the command pool wasn’t created with vk::CommandPoolCreateFlags::RESET_COMMAND_BUFFER
set.
https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkResetCommandBuffer.html
pub fn handle(&self) -> CommandBuffer
pub fn level(&self) -> CommandBufferLevel
pub fn command_pool(&self) -> &Arc<CommandPool>
Sourcepub fn begin(
&self,
begin_info: &CommandBufferBeginInfoBuilder<'_>,
) -> VkResult<()>
pub fn begin( &self, begin_info: &CommandBufferBeginInfoBuilder<'_>, ) -> VkResult<()>
Sourcepub fn begin_render_pass(
&self,
begin_info: &RenderPassBeginInfoBuilder<'_>,
subpass_contents: SubpassContents,
)
pub fn begin_render_pass( &self, begin_info: &RenderPassBeginInfoBuilder<'_>, subpass_contents: SubpassContents, )
Sourcepub fn next_subpass(&self, subpass_contents: SubpassContents)
pub fn next_subpass(&self, subpass_contents: SubpassContents)
Sourcepub fn end_render_pass(&self)
pub fn end_render_pass(&self)
Sourcepub fn bind_pipeline(&self, pipeline: &dyn PipelineAccess)
pub fn bind_pipeline(&self, pipeline: &dyn PipelineAccess)
Sourcepub fn bind_descriptor_sets<'a>(
&self,
pipeline_bind_point: PipelineBindPoint,
pipeline_layout: &PipelineLayout,
first_set: u32,
descriptor_sets: impl IntoIterator<Item = &'a DescriptorSet>,
dynamic_offsets: &[u32],
)
pub fn bind_descriptor_sets<'a>( &self, pipeline_bind_point: PipelineBindPoint, pipeline_layout: &PipelineLayout, first_set: u32, descriptor_sets: impl IntoIterator<Item = &'a DescriptorSet>, dynamic_offsets: &[u32], )
Sourcepub fn bind_vertex_buffers<'a>(
&self,
first_binding: u32,
buffers: impl IntoIterator<Item = &'a Buffer>,
offsets: &[DeviceSize],
)
pub fn bind_vertex_buffers<'a>( &self, first_binding: u32, buffers: impl IntoIterator<Item = &'a Buffer>, offsets: &[DeviceSize], )
Sourcepub fn bind_index_buffer(
&self,
buffer: &Buffer,
offset: DeviceSize,
index_type: IndexType,
)
pub fn bind_index_buffer( &self, buffer: &Buffer, offset: DeviceSize, index_type: IndexType, )
Sourcepub fn set_viewport(&self, first_viewport: u32, viewports: &[Viewport])
pub fn set_viewport(&self, first_viewport: u32, viewports: &[Viewport])
Sourcepub fn set_scissor(&self, first_scissor: u32, scissors: &[Rect2D])
pub fn set_scissor(&self, first_scissor: u32, scissors: &[Rect2D])
Sourcepub fn draw(
&self,
vertex_count: u32,
instance_count: u32,
first_vertex: u32,
first_instance: u32,
)
pub fn draw( &self, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32, )
Sourcepub fn draw_indexed(
&self,
index_count: u32,
instance_count: u32,
first_index: u32,
vertex_offset: i32,
first_instance: u32,
)
pub fn draw_indexed( &self, index_count: u32, instance_count: u32, first_index: u32, vertex_offset: i32, first_instance: u32, )
Sourcepub fn draw_indexed_indirect(
&self,
buffer: &Buffer,
offset: DeviceSize,
draw_count: u32,
stride: u32,
)
pub fn draw_indexed_indirect( &self, buffer: &Buffer, offset: DeviceSize, draw_count: u32, stride: u32, )
Sourcepub fn execute_commands(
&self,
secondary_command_buffers: &[&CommandBuffer],
) -> Result<(), CommandError>
pub fn execute_commands( &self, secondary_command_buffers: &[&CommandBuffer], ) -> Result<(), CommandError>
Sourcepub fn copy_buffer(
&self,
src_buffer: &Buffer,
dst_buffer: &Buffer,
regions: &[BufferCopy],
)
pub fn copy_buffer( &self, src_buffer: &Buffer, dst_buffer: &Buffer, regions: &[BufferCopy], )
Sourcepub fn copy_buffer_to_image(
&self,
src_buffer: &Buffer,
dst_image: &dyn ImageAccess,
dst_image_layout: ImageLayout,
regions: &[BufferImageCopy],
)
pub fn copy_buffer_to_image( &self, src_buffer: &Buffer, dst_image: &dyn ImageAccess, dst_image_layout: ImageLayout, regions: &[BufferImageCopy], )
Sourcepub fn push_constants(
&self,
pipeline_layout: &PipelineLayout,
stage_flags: ShaderStageFlags,
offset: u32,
constants: &[u8],
)
pub fn push_constants( &self, pipeline_layout: &PipelineLayout, stage_flags: ShaderStageFlags, offset: u32, constants: &[u8], )
Trait Implementations§
Source§impl DeviceOwned for CommandBuffer
impl DeviceOwned for CommandBuffer
Auto Trait Implementations§
impl Freeze for CommandBuffer
impl RefUnwindSafe for CommandBuffer
impl Send for CommandBuffer
impl Sync for CommandBuffer
impl Unpin for CommandBuffer
impl UnwindSafe for CommandBuffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more