Vireo  0.0
Vireo 3D Rendering Hardware Interface
CommandList Class Referenceabstract

Detailed Description

A command list (buffer) object

Manual page : Command Lists

Public Member Functions

virtual void begin () const = 0
 
virtual void end () const = 0
 
virtual void upload (const Buffer &destination, const void *source) = 0
 
void upload (const std::shared_ptr< const Buffer > &destination, const void *source)
 
virtual void upload (const std::vector< BufferUploadInfo > &infos)
 
virtual void upload (const Image &destination, const void *source, uint32_t firstMipLevel=0) = 0
 
void upload (const std::shared_ptr< const Image > &destination, const void *source, const uint32_t firstMipLevel=0)
 
virtual void upload (const std::vector< ImageUploadInfo > &infos)
 
void copy (const std::shared_ptr< Buffer > &source, const std::shared_ptr< const Image > &destination, const uint32_t sourceOffset=0, const uint32_t mipLevel=0, const bool rowPitchAlignment=true) const
 
virtual void copy (const Buffer &source, const Image &destination, uint32_t sourceOffset=0, uint32_t mipLevel=0, bool rowPitchAlignment=true) const = 0
 
virtual void copy (const std::shared_ptr< Buffer > &source, const std::shared_ptr< Image > &destination, const std::vector< size_t > &sourceOffsets, bool rowPitchAlignment=true) const
 
virtual void copy (const Buffer &source, const Image &destination, const std::vector< size_t > &sourceOffsets, bool rowPitchAlignment=true) const = 0
 
virtual void copy (const Image &source, const Buffer &destination, uint32_t destinationOffset=0, uint32_t mipLevel=0) const = 0
 
void copy (const std::shared_ptr< const Image > &source, const std::shared_ptr< Buffer > &destination, const uint32_t destinationOffset=0, const uint32_t firstMipLevel=0) const
 
virtual void copy (const Buffer &source, const Buffer &destination, size_t size=Buffer::WHOLE_SIZE, uint32_t sourceOffset=0, uint32_t destinationOffset=0) const = 0
 
void copy (const std::shared_ptr< const Buffer > &source, const std::shared_ptr< const Buffer > &destination, const size_t size=Buffer::WHOLE_SIZE, const uint32_t sourceOffset=0, const uint32_t destinationOffset=0) const
 
virtual void copy (const Buffer &source, const Buffer &destination, const std::vector< BufferCopyRegion > &regions) const = 0
 
void copy (const std::shared_ptr< const Buffer > &source, const std::shared_ptr< const Buffer > &destination, const std::vector< BufferCopyRegion > &regions) const
 
virtual void uploadArray (const Image &destination, const std::vector< void * > &sources, uint32_t firstMipLevel=0) = 0
 
void uploadArray (const std::shared_ptr< const Image > &destination, const std::vector< void * > &sources, const uint32_t firstMipLevel=0)
 
virtual void copy (const Image &source, const SwapChain &swapChain) const = 0
 
void copy (const std::shared_ptr< const Image > &source, const std::shared_ptr< const SwapChain > &swapChain) const
 
void copy (const RenderTarget &source, const SwapChain &swapChain) const
 
void copy (const std::shared_ptr< const RenderTarget > &source, const std::shared_ptr< const SwapChain > &swapChain) const
 
virtual void beginRendering (const RenderingConfiguration &configuration) = 0
 
virtual void endRendering ()
 
virtual void dispatch (uint32_t x, uint32_t y, uint32_t z) const = 0
 
virtual void bindVertexBuffer (const Buffer &buffer, size_t offset=0) const = 0
 
void bindVertexBuffer (const std::shared_ptr< const Buffer > &buffer, const size_t offset=0) const
 
virtual void bindVertexBuffers (const std::vector< std::shared_ptr< const Buffer >> &buffers, std::vector< size_t > offsets={}) const = 0
 
virtual void bindIndexBuffer (const Buffer &buffer, IndexType indexType=IndexType::UINT32, uint32_t firstIndex=0) const = 0
 
void bindIndexBuffer (const std::shared_ptr< const Buffer > &buffer, const IndexType indexType=IndexType::UINT32, const uint32_t firstIndex=0) const
 
virtual void bindPipeline (Pipeline &pipeline) = 0
 
virtual void bindPipeline (const std::shared_ptr< Pipeline > &pipeline)
 
virtual void bindDescriptors (const std::vector< std::shared_ptr< const DescriptorSet >> &descriptors, uint32_t firstSet=0) const = 0
 
virtual void bindDescriptor (const DescriptorSet &descriptor, uint32_t set) const = 0
 
void bindDescriptor (const std::shared_ptr< const DescriptorSet > &descriptor, const uint32_t set) const
 
virtual void bindDescriptor (const DescriptorSet &descriptor, uint32_t set, uint32_t offset) const = 0
 
void bindDescriptor (const std::shared_ptr< const DescriptorSet > &descriptor, const uint32_t set, const uint32_t offset) const
 
virtual void draw (uint32_t vertexCountPerInstance, uint32_t instanceCount=1, uint32_t firstVertex=0, uint32_t firstInstance=0) const = 0
 
virtual void drawIndexed (uint32_t indexCountPerInstance, uint32_t instanceCount=1, uint32_t firstIndex=0, uint32_t firstVertex=0, uint32_t firstInstance=0) const = 0
 
virtual void drawIndirect (const Buffer &buffer, size_t offset, uint32_t drawCount, uint32_t stride, uint32_t firstCommandOffset=0) = 0
 
void drawIndirect (const std::shared_ptr< Buffer > &buffer, const size_t offset, const uint32_t drawCount, const uint32_t stride, const uint32_t firstCommandOffset=0)
 
virtual void drawIndexedIndirectCount (Buffer &buffer, size_t offset, Buffer &countBuffer, size_t countOffset, uint32_t maxDrawCount, uint32_t stride, uint32_t firstCommandOffset=0) = 0
 
void drawIndexedIndirectCount (const std::shared_ptr< Buffer > &buffer, const size_t offset, const std::shared_ptr< Buffer > &countBuffer, const size_t countOffset, const uint32_t maxDrawCount, const uint32_t stride, const uint32_t firstCommandOffset=0)
 
virtual void drawIndexedIndirect (const Buffer &buffer, size_t offset, uint32_t maxDrawCount, uint32_t stride, uint32_t firstCommandOffset=0) = 0
 
void drawIndexedIndirect (const std::shared_ptr< Buffer > &buffer, const size_t offset, const uint32_t maxDrawCount, const uint32_t stride, const uint32_t firstCommandOffset=0)
 
virtual void setViewports (const std::vector< Viewport > &viewports) const = 0
 
virtual void setScissors (const std::vector< Rect > &rects) const = 0
 
virtual void setViewport (const Viewport &viewport) const = 0
 
virtual void setScissors (const Rect &rect) const = 0
 
virtual void setStencilReference (uint32_t reference) const = 0
 
virtual void barrier (const std::shared_ptr< const Image > &image, ResourceState oldState, ResourceState newState, uint32_t firstMipLevel=0, uint32_t levelCount=1) const = 0
 
virtual void barrier (const std::shared_ptr< const RenderTarget > &renderTarget, ResourceState oldState, ResourceState newState) const = 0
 
virtual void barrier (const std::vector< std::shared_ptr< const RenderTarget >> &renderTargets, ResourceState oldState, ResourceState newState) const = 0
 
virtual void barrier (const std::shared_ptr< const SwapChain > &swapChain, ResourceState oldState, ResourceState newState) const = 0
 
virtual void pushConstants (const std::shared_ptr< const PipelineResources > &pipelineResources, const PushConstantsDesc &pushConstants, const void *data) const = 0
 
virtual void barrier (const Buffer &buffer, ResourceState oldState, ResourceState newState) const = 0
 
virtual void cleanup () = 0
 
virtual ~CommandList () = default
 
 CommandList (CommandList &) = delete
 
CommandList & operator= (const CommandList &) = delete
 

Static Public Attributes

static constexpr uint32_t indexTypeSize []
 

Protected Member Functions

 CommandList () = default
 

Protected Attributes

PipelinecurrentlyBoundPipeline {nullptr}
 

Constructor & Destructor Documentation

virtual ~CommandList ( )
virtualdefault
CommandList ( CommandList &  )
delete
CommandList ( )
protecteddefault

Member Function Documentation

virtual void barrier ( const Buffer buffer,
ResourceState  oldState,
ResourceState  newState 
) const
pure virtual
virtual void barrier ( const std::shared_ptr< const Image > &  image,
ResourceState  oldState,
ResourceState  newState,
uint32_t  firstMipLevel = 0,
uint32_t  levelCount = 1 
) const
pure virtual

Insert a memory dependency

Parameters
imageThe image affected by this barrier.
oldStateOld state in an image state transition.
newStateNew state in an image state transition.
firstMipLevelThe first mip level to include is this barrier
levelCountNumber of level to include
virtual void barrier ( const std::shared_ptr< const RenderTarget > &  renderTarget,
ResourceState  oldState,
ResourceState  newState 
) const
pure virtual

Insert a memory dependency

Parameters
renderTargetThe image affected by this barrier.
oldStateOld state in an image state transition.
newStateNew state in an image state transition.
virtual void barrier ( const std::shared_ptr< const SwapChain > &  swapChain,
ResourceState  oldState,
ResourceState  newState 
) const
pure virtual

Insert a memory dependency

Parameters
swapChainThe image affected by this barrier.
oldStateOld state in an image state transition.
newStateNew state in an image state transition.
virtual void barrier ( const std::vector< std::shared_ptr< const RenderTarget >> &  renderTargets,
ResourceState  oldState,
ResourceState  newState 
) const
pure virtual

Insert a memory dependency

Parameters
renderTargetsThe images affected by this barrier.
oldStateOld state in an image state transition.
newStateNew state in an image state transition.
virtual void begin ( ) const
pure virtual

Start recording a command list

virtual void beginRendering ( const RenderingConfiguration configuration)
pure virtual

Begin a render pass

virtual void bindDescriptor ( const DescriptorSet descriptor,
uint32_t  set 
) const
pure virtual

Bind descriptor set to a command list

Parameters
descriptorThe descriptor set to bind
setThe set number of the descriptor set to be bound
virtual void bindDescriptor ( const DescriptorSet descriptor,
uint32_t  set,
uint32_t  offset 
) const
pure virtual

Binds a dynamic uniform descriptor set to a command list

Parameters
descriptorThe descriptor set to bind
setThe set number of the descriptor set to be bound
offsetValues specifying dynamic offsets for the UNIFORM_DYNAMIC resource.
void bindDescriptor ( const std::shared_ptr< const DescriptorSet > &  descriptor,
const uint32_t  set 
) const
inline

Binds descriptor set to a command list

Parameters
descriptorThe descriptor set to bind
setThe set number of the descriptor set to be bound
void bindDescriptor ( const std::shared_ptr< const DescriptorSet > &  descriptor,
const uint32_t  set,
const uint32_t  offset 
) const
inline

Binds a dynamic uniform descriptor set to a command list

Parameters
descriptorThe descriptor set to bind
setThe set number of the descriptor set to be bound
offsetValues specifying dynamic offsets for the UNIFORM_DYNAMIC resource.
virtual void bindDescriptors ( const std::vector< std::shared_ptr< const DescriptorSet >> &  descriptors,
uint32_t  firstSet = 0 
) const
pure virtual

Bind descriptor sets to a command list

Parameters
descriptorsThe descriptor sets to bind
firstSetThe set number of the first descriptor set to be bound
virtual void bindIndexBuffer ( const Buffer buffer,
IndexType  indexType = IndexType::UINT32,
uint32_t  firstIndex = 0 
) const
pure virtual

Binds an index buffer to a command list

Parameters
bufferAn index buffer
indexTypeValue specifying the size of the indices
firstIndexFirst index in the buffer
void bindIndexBuffer ( const std::shared_ptr< const Buffer > &  buffer,
const IndexType  indexType = IndexType::UINT32,
const uint32_t  firstIndex = 0 
) const
inline

Binds an index buffer to a command list

Parameters
bufferAn index buffer
indexTypeValue specifying the size of the indices
firstIndexFirst index in the buffer
virtual void bindPipeline ( const std::shared_ptr< Pipeline > &  pipeline)
inlinevirtual

Binds a pipeline object to a command list

virtual void bindPipeline ( Pipeline pipeline)
pure virtual

Binds a pipeline object to a command list

virtual void bindVertexBuffer ( const Buffer buffer,
size_t  offset = 0 
) const
pure virtual

Bind a vertex buffer to a command list

Parameters
bufferA vertex buffer
offsetOffset in bytes
void bindVertexBuffer ( const std::shared_ptr< const Buffer > &  buffer,
const size_t  offset = 0 
) const
inline

Bind a vertex buffer to a command list

Parameters
bufferA vertex buffer
offsetOffset in bytes
virtual void bindVertexBuffers ( const std::vector< std::shared_ptr< const Buffer >> &  buffers,
std::vector< size_t >  offsets = {} 
) const
pure virtual

Binds vertex buffers to a command list

Parameters
buffersBuffers to bind
offsetsOffsets for each buffer in bytes
virtual void cleanup ( )
pure virtual

Cleanup staging buffers used by upload functions

virtual void copy ( const Buffer source,
const Buffer destination,
const std::vector< BufferCopyRegion > &  regions 
) const
pure virtual

Copy multiple regions of a buffer into another buffer

virtual void copy ( const Buffer source,
const Buffer destination,
size_t  size = Buffer::WHOLE_SIZE,
uint32_t  sourceOffset = 0,
uint32_t  destinationOffset = 0 
) const
pure virtual

Copy data from a buffer into another buffer

virtual void copy ( const Buffer source,
const Image destination,
const std::vector< size_t > &  sourceOffsets,
bool  rowPitchAlignment = true 
) const
pure virtual

Copy data from a buffer into a multi-level image. One sourceOffset offset in bytes for each level. If rowPitchAlignment is true (for Vulkan), the data in the buffer must have row-aligned data (cf. Image::IMAGE_ROW_PITCH_ALIGNMENT) for cross-API compatibility.

virtual void copy ( const Buffer source,
const Image destination,
uint32_t  sourceOffset = 0,
uint32_t  mipLevel = 0,
bool  rowPitchAlignment = true 
) const
pure virtual

Copy data from a buffer into an image level. If rowPitchAlignment is true (for Vulkan), the data in the buffer must have row-aligned data (cf. Image::IMAGE_ROW_PITCH_ALIGNMENT) for cross-API compatibility.

virtual void copy ( const Image source,
const Buffer destination,
uint32_t  destinationOffset = 0,
uint32_t  mipLevel = 0 
) const
pure virtual

Copy a level of an image into a buffer

virtual void copy ( const Image source,
const SwapChain swapChain 
) const
pure virtual

Copy an image into the current swap chain image

void copy ( const RenderTarget source,
const SwapChain swapChain 
) const
inline

Copy an image into the current swap chain image

void copy ( const std::shared_ptr< Buffer > &  source,
const std::shared_ptr< const Image > &  destination,
const uint32_t  sourceOffset = 0,
const uint32_t  mipLevel = 0,
const bool  rowPitchAlignment = true 
) const
inline

Copy data from a buffer into an image level. If rowPitchAlignment is true (for Vulkan), the data in the buffer must have row-aligned data (cf. Image::IMAGE_ROW_PITCH_ALIGNMENT) for cross-API compatibility.

virtual void copy ( const std::shared_ptr< Buffer > &  source,
const std::shared_ptr< Image > &  destination,
const std::vector< size_t > &  sourceOffsets,
bool  rowPitchAlignment = true 
) const
inlinevirtual

Copy data from a buffer into a multi-level image. One sourceOffset offset in bytes for each level. If rowPitchAlignment is true (for Vulkan), the data in the buffer must have row-aligned data (cf. Image::IMAGE_ROW_PITCH_ALIGNMENT) for cross-API compatibility.

void copy ( const std::shared_ptr< const Buffer > &  source,
const std::shared_ptr< const Buffer > &  destination,
const size_t  size = Buffer::WHOLE_SIZE,
const uint32_t  sourceOffset = 0,
const uint32_t  destinationOffset = 0 
) const
inline

Copy data from a buffer into another buffer

void copy ( const std::shared_ptr< const Buffer > &  source,
const std::shared_ptr< const Buffer > &  destination,
const std::vector< BufferCopyRegion > &  regions 
) const
inline

Copy multiple regions of a buffer into another buffer

void copy ( const std::shared_ptr< const Image > &  source,
const std::shared_ptr< Buffer > &  destination,
const uint32_t  destinationOffset = 0,
const uint32_t  firstMipLevel = 0 
) const
inline

Copy an image into a buffer

void copy ( const std::shared_ptr< const Image > &  source,
const std::shared_ptr< const SwapChain > &  swapChain 
) const
inline

Copy an image into the current swap chain image

void copy ( const std::shared_ptr< const RenderTarget > &  source,
const std::shared_ptr< const SwapChain > &  swapChain 
) const
inline

Copy an image into the current swap chain image

virtual void dispatch ( uint32_t  x,
uint32_t  y,
uint32_t  z 
) const
pure virtual

Dispatch compute work items

Parameters
xThe number of local workgroups to dispatch in the X dimension.
yThe number of local workgroups to dispatch in the Y dimension.
zThe number of local workgroups to dispatch in the Z dimension.
virtual void draw ( uint32_t  vertexCountPerInstance,
uint32_t  instanceCount = 1,
uint32_t  firstVertex = 0,
uint32_t  firstInstance = 0 
) const
pure virtual

Draw primitives

Parameters
vertexCountPerInstanceThe number of vertices per instance to draw
instanceCountThe number of instances
firstVertexThe index of the first vertex to draw
firstInstanceThe index of the first instance to draw.
virtual void drawIndexed ( uint32_t  indexCountPerInstance,
uint32_t  instanceCount = 1,
uint32_t  firstIndex = 0,
uint32_t  firstVertex = 0,
uint32_t  firstInstance = 0 
) const
pure virtual

Draw primitives with indexed vertices

Parameters
indexCountPerInstanceThe number of vertices per instance to draw
instanceCountThe number of instances
firstIndexThe base index within the index buffer.
firstVertexThe value added to the vertex index before indexing into the vertex buffer.
firstInstanceThe index of the first instance to draw.
virtual void drawIndexedIndirect ( const Buffer buffer,
size_t  offset,
uint32_t  maxDrawCount,
uint32_t  stride,
uint32_t  firstCommandOffset = 0 
)
pure virtual

Draw primitives with indirect parameters and indexed vertices

Parameters
bufferThe buffer containing draw parameters.
offsetThe byte offset into the buffer where parameters begin.
maxDrawCountThe maximum number of draws that will be executed. The actual number of executed draw calls is the minimum of the count specified in countBuffer and maxDrawCount
strideThe byte stride between successive sets of draw parameters.
void drawIndexedIndirect ( const std::shared_ptr< Buffer > &  buffer,
const size_t  offset,
const uint32_t  maxDrawCount,
const uint32_t  stride,
const uint32_t  firstCommandOffset = 0 
)
inline

Draw primitives with indirect parameters and indexed vertices

Parameters
bufferThe buffer containing draw parameters.
offsetThe byte offset into the buffer where parameters begin.
maxDrawCountThe maximum number of draws that will be executed. The actual number of executed draw calls is the minimum of the count specified in countBuffer and maxDrawCount
strideThe byte stride between successive sets of draw parameters.
virtual void drawIndexedIndirectCount ( Buffer buffer,
size_t  offset,
Buffer countBuffer,
size_t  countOffset,
uint32_t  maxDrawCount,
uint32_t  stride,
uint32_t  firstCommandOffset = 0 
)
pure virtual

Draw primitives with indirect parameters and indexed vertices

Parameters
bufferThe buffer containing draw parameters.
offsetThe byte offset into the buffer where parameters begin.
countBufferThe buffer containing the draw count.
countOffsetThe byte offset into countBuffer where the draw count begins.
maxDrawCountThe maximum number of draws that will be executed. The actual number of executed draw calls is the minimum of the count specified in countBuffer and maxDrawCount
strideThe byte stride between successive sets of draw parameters.
void drawIndexedIndirectCount ( const std::shared_ptr< Buffer > &  buffer,
const size_t  offset,
const std::shared_ptr< Buffer > &  countBuffer,
const size_t  countOffset,
const uint32_t  maxDrawCount,
const uint32_t  stride,
const uint32_t  firstCommandOffset = 0 
)
inline

Draw primitives with indirect parameters and indexed vertices

Parameters
bufferThe buffer containing draw parameters.
offsetThe byte offset into the buffer where parameters begin.
countBufferThe buffer containing the draw count.
countOffsetThe byte offset into countBuffer where the draw count begins.
maxDrawCountThe maximum number of draws that will be executed. The actual number of executed draw calls is the minimum of the count specified in countBuffer and maxDrawCount
strideThe byte stride between successive sets of draw parameters.
virtual void drawIndirect ( const Buffer buffer,
size_t  offset,
uint32_t  drawCount,
uint32_t  stride,
uint32_t  firstCommandOffset = 0 
)
pure virtual

Draw primitives with indirect parameters

Parameters
bufferThe buffer containing draw parameters.
offsetThe byte offset into the buffer where parameters begin.
drawCountThe number of draws to execute, and can be zero.
strideThe byte stride between successive sets of draw parameters.
void drawIndirect ( const std::shared_ptr< Buffer > &  buffer,
const size_t  offset,
const uint32_t  drawCount,
const uint32_t  stride,
const uint32_t  firstCommandOffset = 0 
)
inline

Draw primitives with indirect parameters

Parameters
bufferThe buffer containing draw parameters.
offsetThe byte offset into the buffer where parameters begin.
drawCountThe number of draws to execute, and can be zero.
strideThe byte stride between successive sets of draw parameters.
virtual void end ( ) const
pure virtual

Stop recording a command list

virtual void endRendering ( )
inlinevirtual

End a render pass

CommandList& operator= ( const CommandList &  )
delete
virtual void pushConstants ( const std::shared_ptr< const PipelineResources > &  pipelineResources,
const PushConstantsDesc pushConstants,
const void *  data 
) const
pure virtual

Update the values of push constants

Parameters
pipelineResourcesThe pipeline layout used to program the push constant updates.
pushConstantsThe push constant description
dataThe new push constant values.
virtual void setScissors ( const Rect rect) const
pure virtual

Sets the scissors for a command list

Parameters
rectAn array of Extent structures specifying viewport parameters.
virtual void setScissors ( const std::vector< Rect > &  rects) const
pure virtual

Sets the scissors for a command list

Parameters
rectsAn array of Rect structures specifying viewport parameters.
virtual void setStencilReference ( uint32_t  reference) const
pure virtual

Set the reference value for stencil tests and operations

virtual void setViewport ( const Viewport viewport) const
pure virtual

Sets the viewport for a command list

Parameters
viewportAn array of Extent structures specifying viewport parameters.
virtual void setViewports ( const std::vector< Viewport > &  viewports) const
pure virtual

Sets the viewports for a command list

Parameters
viewportsAn array of Viewport structures specifying viewport parameters
virtual void upload ( const Buffer destination,
const void *  source 
)
pure virtual

Uploads data into a buffer using a temporary (staging) buffer.

virtual void upload ( const Image destination,
const void *  source,
uint32_t  firstMipLevel = 0 
)
pure virtual

Upload data into an image using a temporary (staging) buffer.

void upload ( const std::shared_ptr< const Buffer > &  destination,
const void *  source 
)
inline

Uploads data into a buffer using a temporary (staging) buffer.

void upload ( const std::shared_ptr< const Image > &  destination,
const void *  source,
const uint32_t  firstMipLevel = 0 
)
inline

Upload data into an image using a temporary (staging) buffer.

virtual void upload ( const std::vector< BufferUploadInfo > &  infos)
virtual

Uploads data into buffers using temporary (staging) buffers.

virtual void upload ( const std::vector< ImageUploadInfo > &  infos)
virtual

Uploads data into images using temporary (staging) buffers.

virtual void uploadArray ( const Image destination,
const std::vector< void * > &  sources,
uint32_t  firstMipLevel = 0 
)
pure virtual

Upload images into an image array

void uploadArray ( const std::shared_ptr< const Image > &  destination,
const std::vector< void * > &  sources,
const uint32_t  firstMipLevel = 0 
)
inline

Upload images into an image array

Member Data Documentation

Pipeline* currentlyBoundPipeline {nullptr}
protected
constexpr uint32_t indexTypeSize[]
staticconstexpr
Initial value:
{
2,
4
}