CommandBuffer

Struct CommandBuffer 

Source
pub struct CommandBuffer { /* private fields */ }

Implementations§

Source§

impl CommandBuffer

Source

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.

Source

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

Source

pub fn handle(&self) -> CommandBuffer

Source

pub fn level(&self) -> CommandBufferLevel

Source

pub fn command_pool(&self) -> &Arc<CommandPool>

Source

pub fn begin( &self, begin_info: &CommandBufferBeginInfoBuilder<'_>, ) -> VkResult<()>

Source

pub fn end(&self) -> VkResult<()>

Source

pub fn begin_render_pass( &self, begin_info: &RenderPassBeginInfoBuilder<'_>, subpass_contents: SubpassContents, )

Source

pub fn next_subpass(&self, subpass_contents: SubpassContents)

Source

pub fn end_render_pass(&self)

Source

pub fn bind_pipeline(&self, pipeline: &dyn PipelineAccess)

Source

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], )

Source

pub fn bind_vertex_buffers<'a>( &self, first_binding: u32, buffers: impl IntoIterator<Item = &'a Buffer>, offsets: &[DeviceSize], )

Source

pub fn bind_index_buffer( &self, buffer: &Buffer, offset: DeviceSize, index_type: IndexType, )

Source

pub fn set_viewport(&self, first_viewport: u32, viewports: &[Viewport])

Source

pub fn set_scissor(&self, first_scissor: u32, scissors: &[Rect2D])

Source

pub fn draw( &self, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32, )

Source

pub fn draw_indexed( &self, index_count: u32, instance_count: u32, first_index: u32, vertex_offset: i32, first_instance: u32, )

Source

pub fn draw_indexed_indirect( &self, buffer: &Buffer, offset: DeviceSize, draw_count: u32, stride: u32, )

Source

pub fn execute_commands( &self, secondary_command_buffers: &[&CommandBuffer], ) -> Result<(), CommandError>

Source

pub fn copy_buffer( &self, src_buffer: &Buffer, dst_buffer: &Buffer, regions: &[BufferCopy], )

Source

pub fn copy_buffer_to_image( &self, src_buffer: &Buffer, dst_image: &dyn ImageAccess, dst_image_layout: ImageLayout, regions: &[BufferImageCopy], )

Source

pub fn push_constants( &self, pipeline_layout: &PipelineLayout, stage_flags: ShaderStageFlags, offset: u32, constants: &[u8], )

Trait Implementations§

Source§

impl DeviceOwned for CommandBuffer

Source§

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

Source§

fn handle_raw(&self) -> u64

Source§

impl Drop for CommandBuffer

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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> 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.