VV::V3::CommandBuffer class

Command buffers are objects used to record commands which can be subsequently submitted to a device queue for execution.

This object only acts as a host interface to a given device object's handle. Since command pools handle the lifetime of a command buffer, The command buffer can only clear its references to the device object.

Base classes

struct VV::V2::CommandBuffer
Command buffers are objects used to record commands which can be subsequently submitted to a device queue for execution.

Public types

using Parent = V2::CommandBuffer
using AllocateInfo = V2::CommandPool::AllocateInfo

Constructors, destructors, conversion operators

CommandBuffer()
Default constructor.
CommandBuffer(const LogicalDevice& _device, Handle& _handle)
Constructor with logical device, allocate info, and handle specified (acts as an Assign() call)
operator Handle&()
Implicit conversion to give a reference to its handle.
operator const Handle&() const
Implicit conversion to give a readonly reference to its handle.
operator const Handle*() const
Implicit conversion to give a pointers to its handle.

Public functions

void Assign(const LogicalDevice& _device, Handle& _handle)
Assign a device and handle.
void Clear()
Clear references to related device objects.
auto BeginRecord(const BeginInfo& _info) const -> EResult
Begin recording commands to the buffer.
void BeginRenderPass(const RenderPass::BeginInfo& _info, ESubpassContents _contents) const
Begin recording a render pass set of commands into the buffer.
void BindDescriptorSets(EPipelineBindPoint _bindPoint, const Pipeline::Layout& _layout, ui32 _firstSet, ui32 _descritporSetCount, const DescriptorSet::Handle* _descriptorSets) const
Bind one or more descriptor sets to a command buffer. (No dynamic offsets)
void BindDescriptorSets(EPipelineBindPoint _bindPoint, const Pipeline::Layout& _layout, ui32 _firstSet, ui32 _descritporSetCount, const DescriptorSet::Handle* _descriptorSets, ui32 _dynamicOffsetCount, const ui32* _dynamicOffsets) const
Bind one or more descriptor sets to a command buffer.
void BindIndexBuffer(const Buffer& _buffer, DeviceSize _offset, EIndexType _type) const
Bind an index buffer to a command buffer.
void BindVertexBuffers(ui32 _firstBinding, ui32 _bindingCount, const Buffer::Handle* _buffers) const
Bind vertex buffers to a command buffer for use in subsequent draw commands. (No offsets)
void BindVertexBuffers(ui32 _firstBinding, ui32 _bindingCount, const Buffer::Handle* _buffers, const DeviceSize* _offsets) const
Bind vertex buffers to a command buffer for use in subsequent draw commands.
void BindPipeline(EPipelineBindPoint _bindPoint, Pipeline& _pipeline) const
Bind a pipeline to a command buffer for use in subsequent commands. (Until another pipeline is bound)
void BlitImage(Image& _src, EImageLayout _srcLayout, Image& _dst, EImageLayout _dstLayout, ui32 _regionCount, const Image::Blit* _regions, EFilter _filter) const
Copy regions of a source image into a destination image, potentially performing format conversion, arbitrary scaling, and filtering.
void CopyBuffer(Buffer& _sourceBuffer, Buffer& _destinationBuffer, ui32 _regionCount, const Buffer::CopyInfo* _regions) const
Copy data between buffer objects.
void CopyBufferToImage(Buffer& _srcBuffer, Image& _dstImage, EImageLayout _dstImageLayout, ui32 _regionCount, const BufferImageRegion* _regions) const
Copy data from a buffer object to an image object.
void Draw(ui32 _firstVertex, ui32 _vertexCount, ui32 _firstInstance, ui32 _instanceCount) const
Record a non-indexed draw.
void DrawIndexed(ui32 _indexCount, ui32 _instanceCount, ui32 _firstIndex, si32 _vertexOffset, ui32 _firstInstance) const
Record an indexed draw.
auto EndRecord() const -> EResult
complete recording of a command buffer.
void EndRenderPass() const
record a command to end a render pass instance after recording the commands for the last subpass.
void Execute(ui32 _secondaryBufferCount, const Handle* _secondaryBuffers) const
A secondary command buffer must not be directly submitted to a queue. Instead, secondary command buffers are recorded to execute as part of a primary command buffer..
void ResetEvent(Event& _event, Pipeline::StageFlags _stageMask) const
Set the state of an event to unsignaled from a device.
void SetDeviceMask(ui32 _deviceMask) const
Update the current device bitfield of a command buffer.
void SetEvent(Event& _event, Pipeline::StageFlags _stageMask) const
Set the state of an event to signaled from a device.
void SetScissor(ui32 _firstScissor, ui32 _scissorCount, const Rect2D* _scissors) const
Set scissor rectangles dynamically.
void SetScissor(const DynamicArray<Rect2D>& _scissors) const
Set scissor rectangles dynamically.
void SetScissor(const Rect2D& _scissor) const
Set scissor rectangles dynamically. (Single scissor)
void SetViewport(ui32 _firstViewport, ui32 _viewportCount, const Viewport* _viewports) const
Set viewport transformation parameters dynamically.
void SetViewport(const DynamicArray<Viewport>& _viewports) const
Set viewport transformation parameters dynamically.
void SetViewport(const Viewport& _viewport) const
Set viewport transformation parameters dynamically. (Single viewport)
void SubmitPipelineBarrier(Pipeline::StageFlags _sourceStageMask, Pipeline::StageFlags _destinationStageMask, DependencyFlags _dependencyFlags, ui32 _memoryBarrierCount, const Memory::Barrier* _memoryBarriers) const
A version of SubmitPipelineBarrier where only a set of regular memory barriers are submitted.
void SubmitPipelineBarrier(Pipeline::StageFlags _sourceStageMask, Pipeline::StageFlags _destinationStageMask, DependencyFlags _dependencyFlags, ui32 _bufferMemoryBarrierCount, const Buffer::Memory_Barrier* _bufferMemoryBarriers) const
A version where only a set of buffer memory barriers are submitted.
void SubmitPipelineBarrier(Pipeline::StageFlags _sourceStageMask, Pipeline::StageFlags _destinationStageMask, DependencyFlags _dependencyFlags, ui32 _imageMemoryBarrierCount, const Image::Memory_Barrier* _imageMemoryBarriers) const
A version of SubmitPipelineBarrier where only a set of image memory barriers are submitted.
void SubmitPipelineBarrier(Pipeline::StageFlags _sourceStageMask, Pipeline::StageFlags _destinationStageMask, DependencyFlags _dependencyFlags, ui32 _memoryBarrierCount, const Memory::Barrier* _memoryBarriers, ui32 _bufferMemoryBarrierCount, const Buffer::Memory_Barrier* _bufferMemoryBarriers, ui32 _imageMemoryBarrierCount, const Image::Memory_Barrier* _imageMemoryBarriers) const
Record a pipeline barrier.
void WaitForEvents(ui32 _eventCount, const Event::Handle* _events, Pipeline::StageFlags _srcStageMask, Pipeline::StageFlags _dstStageMask, ui32 _memoryBarrierCount, const Memory::Barrier* _memoryBarriers) const
A version of WaitForEvents where only a set of memory barriers are waited on.
void WaitForEvents(ui32 _eventCount, const Event::Handle* _events, Pipeline::StageFlags _srcStageMask, Pipeline::StageFlags _dstStageMask, ui32 _bufferMemoryBarrierCount, const Buffer::Memory_Barrier* _bufferMemoryBarriers) const
A version of WaitForEvents where only a set of buffer memory barriers are waited on.
void WaitForEvents(ui32 _eventCount, const Event::Handle* _events, Pipeline::StageFlags _srcStageMask, Pipeline::StageFlags _dstStageMask, ui32 _imageMemoryBarrierCount, const Image::Memory_Barrier* _imageMemoryBarriers) const
A version of WaitForEvents where only a set of image memory barriers are waited on.
void WaitForEvents(ui32 _eventCount, const Event::Handle* _events, Pipeline::StageFlags _srcStageMask, Pipeline::StageFlags _dstStageMask, ui32 _memoryBarrierCount, const Memory::Barrier* _memoryBarriers, ui32 _bufferMemoryBarrierCount, const Buffer::Memory_Barrier* _bufferMemoryBarriers, ui32 _imageMemoryBarrierCount, const Image::Memory_Barrier* _imageMemoryBarriers) const
Wait for one or more events to enter the signaled state on a device.
auto operator==(const CommandBuffer& _other) const -> bool
Checks to see if its the same object by checking to see if its the same handle.

Protected variables

Handle handle
const LogicalDevice* device

Function documentation

EResult VV::V3::CommandBuffer::BeginRecord(const BeginInfo& _info) const

Begin recording commands to the buffer.

Command buffer recording follows an immediate design. Calls done related to this buffer will be recorded by the buffer.