pub struct CommandBuffer {
pub device: Device,
pub handle: CommandBuffer,
pub info: CommandBufferInfo,
/* private fields */
}Expand description
Represents a Vulkan command buffer allocation.
See VkCommandBuffer.
Fields§
§device: DeviceThe device which owns this command buffer resource.
Note: This field is read-only.
handle: CommandBufferThe native Vulkan resource handle of this command buffer.
Note: This field is read-only.
info: CommandBufferInfoInformation used to create this object.
Implementations§
Source§impl CommandBuffer
impl CommandBuffer
Sourcepub fn begin(
&self,
info: &CommandBufferBeginInfo<'_>,
) -> Result<(), DriverError>
pub fn begin( &self, info: &CommandBufferBeginInfo<'_>, ) -> Result<(), DriverError>
Begins recording this command buffer.
This is a thin wrapper around ash::Device::begin_command_buffer that maps Vulkan errors
to DriverError variants.
See vkBeginCommandBuffer.
Sourcepub fn create(
device: &Device,
info: impl Into<CommandBufferInfo>,
) -> Result<Self, DriverError>
pub fn create( device: &Device, info: impl Into<CommandBufferInfo>, ) -> Result<Self, DriverError>
Creates a command buffer allocation backed by a transient resettable command pool.
Sourcepub fn end(&self) -> Result<(), DriverError>
pub fn end(&self) -> Result<(), DriverError>
Ends recording this command buffer.
This is a thin wrapper around ash::Device::end_command_buffer that maps Vulkan errors
to DriverError variants.
See vkEndCommandBuffer.
Sourcepub fn end_render_pass(&self)
pub fn end_render_pass(&self)
Ends recording a render pass.
Sourcepub fn queue_submit(
&self,
queue: Queue,
fence: &mut Fence,
submits: &[SubmitInfo<'_>],
) -> Result<(), DriverError>
pub fn queue_submit( &self, queue: Queue, fence: &mut Fence, submits: &[SubmitInfo<'_>], ) -> Result<(), DriverError>
Submits command buffers to a queue using fence.
This method does not begin, end, or reset self or fence. Callers are expected to
submit only executable command buffers and to manage fence waits and resets as needed.
Typical handling is:
- Begin recording with
Self::begin. - Record commands.
- End recording with
Self::end. - Submit this command buffer with
queue_submit. - Later, check or wait for completion with
Fence::statusorFence::wait. - Before re-submitting this same command buffer, reset the fence with
Fence::reset, then begin recording again.
See vkQueueSubmit.
Sourcepub fn queue_submit2(
&self,
queue: Queue,
fence: &mut Fence,
submits: &[SubmitInfo2<'_>],
) -> Result<(), DriverError>
pub fn queue_submit2( &self, queue: Queue, fence: &mut Fence, submits: &[SubmitInfo2<'_>], ) -> Result<(), DriverError>
Submits command buffers to a queue using vkQueueSubmit2 (Vulkan 1.3 core or
VK_KHR_synchronization2).
See vkQueueSubmit2
and VK_KHR_synchronization2.
Sourcepub fn set_debug_name(&self, name: impl AsRef<str>)
pub fn set_debug_name(&self, name: impl AsRef<str>)
Sets the debugging name assigned to this command buffer.
Sourcepub fn with_debug_name(self, name: impl AsRef<str>) -> Self
pub fn with_debug_name(self, name: impl AsRef<str>) -> Self
Sets the debugging name assigned to this command buffer.