LiteFX 0.4.1.2025
Computer Graphics Engine
|
Represents a command buffer, that buffers commands that should be submitted to a CommandQueue. More...
#include <rendering.hpp>
Inherits LiteFX::Rendering::ICommandBuffer.
Public Types | |
using | command_buffer_type = TCommandBuffer |
using | buffer_type = TBuffer |
using | vertex_buffer_type = TVertexBuffer |
using | index_buffer_type = TIndexBuffer |
using | image_type = TImage |
using | barrier_type = TBarrier |
using | pipeline_type = TPipeline |
using | pipeline_layout_type = pipeline_type::pipeline_layout_type |
using | descriptor_set_layout_type = pipeline_layout_type::descriptor_set_layout_type |
using | push_constants_layout_type = pipeline_layout_type::push_constants_layout_type |
using | descriptor_set_type = descriptor_set_layout_type::descriptor_set_type |
using | bottom_level_acceleration_structure_type = TBLAS |
using | top_level_acceleration_structure_type = TTLAS |
Public Member Functions | |
~CommandBuffer () noexcept override=default | |
virtual UniquePtr< barrier_type > | makeBarrier (PipelineStage syncBefore, PipelineStage syncAfter) const =0 |
virtual void | barrier (const barrier_type &barrier) const noexcept=0 |
virtual void | transfer (const buffer_type &source, const buffer_type &target, UInt32 sourceElement=0, UInt32 targetElement=0, UInt32 elements=1) const =0 |
virtual void | transfer (const void *const data, size_t size, const buffer_type &target, UInt32 targetElement=0, UInt32 elements=1) const =0 |
virtual void | transfer (Span< const void *const > data, size_t elementSize, const buffer_type &target, UInt32 firstElement=0) const =0 |
virtual void | transfer (const buffer_type &source, const image_type &target, UInt32 sourceElement=0, UInt32 firstSubresource=0, UInt32 elements=1) const =0 |
virtual void | transfer (const void *const data, size_t size, const image_type &target, UInt32 subresource=0) const =0 |
virtual void | transfer (Span< const void *const > data, size_t elementSize, const image_type &target, UInt32 firstSubresource=0, UInt32 subresources=1) const =0 |
virtual void | transfer (const image_type &source, const image_type &target, UInt32 sourceSubresource=0, UInt32 targetSubresource=0, UInt32 subresources=1) const =0 |
virtual void | transfer (const image_type &source, const buffer_type &target, UInt32 firstSubresource=0, UInt32 targetElement=0, UInt32 subresources=1) const =0 |
virtual void | transfer (const SharedPtr< const buffer_type > &source, const buffer_type &target, UInt32 sourceElement=0, UInt32 targetElement=0, UInt32 elements=1) const =0 |
virtual void | transfer (const SharedPtr< const buffer_type > &source, const image_type &target, UInt32 sourceElement=0, UInt32 firstSubresource=0, UInt32 elements=1) const =0 |
virtual void | transfer (const SharedPtr< const image_type > &source, const image_type &target, UInt32 sourceSubresource=0, UInt32 targetSubresource=0, UInt32 subresources=1) const =0 |
virtual void | transfer (const SharedPtr< const image_type > &source, const buffer_type &target, UInt32 firstSubresource=0, UInt32 targetElement=0, UInt32 subresources=1) const =0 |
virtual void | use (const pipeline_type &pipeline) const noexcept=0 |
virtual void | bind (const descriptor_set_type &descriptorSet) const =0 |
virtual void | bind (Span< const descriptor_set_type * > descriptorSets) const =0 |
virtual void | bind (const descriptor_set_type &descriptorSet, const pipeline_type &pipeline) const =0 |
virtual void | bind (Span< const descriptor_set_type * > descriptorSets, const pipeline_type &pipeline) const =0 |
virtual void | bind (const vertex_buffer_type &buffer) const noexcept=0 |
virtual void | bind (const index_buffer_type &buffer) const noexcept=0 |
virtual void | pushConstants (const push_constants_layout_type &layout, const void *const memory) const =0 |
virtual void | dispatchIndirect (const buffer_type &batchBuffer, UInt32 batchCount, UInt64 offset=0) const noexcept=0 |
virtual void | dispatchMeshIndirect (const buffer_type &batchBuffer, UInt32 batchCount, UInt64 offset=0) const noexcept=0 |
virtual void | dispatchMeshIndirect (const buffer_type &batchBuffer, const buffer_type &countBuffer, UInt64 offset=0, UInt64 countOffset=0, UInt32 maxBatches=std::numeric_limits< UInt32 >::max()) const noexcept=0 |
virtual void | drawIndirect (const buffer_type &batchBuffer, UInt32 batchCount, UInt64 offset=0) const noexcept=0 |
virtual void | drawIndirect (const buffer_type &batchBuffer, const buffer_type &countBuffer, UInt64 offset=0, UInt64 countOffset=0, UInt32 maxBatches=std::numeric_limits< UInt32 >::max()) const noexcept=0 |
virtual void | drawIndexedIndirect (const buffer_type &batchBuffer, UInt32 batchCount, UInt64 offset=0) const noexcept=0 |
virtual void | drawIndexedIndirect (const buffer_type &batchBuffer, const buffer_type &countBuffer, UInt64 offset=0, UInt64 countOffset=0, UInt32 maxBatches=std::numeric_limits< UInt32 >::max()) const noexcept=0 |
virtual void | draw (const vertex_buffer_type &vertexBuffer, UInt32 instances=1, UInt32 firstVertex=0, UInt32 firstInstance=0) const |
virtual void | drawIndexed (const index_buffer_type &indexBuffer, UInt32 instances=1, UInt32 firstIndex=0, Int32 vertexOffset=0, UInt32 firstInstance=0) const |
virtual void | drawIndexed (const vertex_buffer_type &vertexBuffer, const index_buffer_type &indexBuffer, UInt32 instances=1, UInt32 firstIndex=0, Int32 vertexOffset=0, UInt32 firstInstance=0) const |
virtual void | execute (const SharedPtr< const command_buffer_type > &commandBuffer) const =0 |
virtual void | execute (Enumerable< SharedPtr< const command_buffer_type > > commandBuffers) const =0 |
virtual void | buildAccelerationStructure (bottom_level_acceleration_structure_type &blas, const SharedPtr< const buffer_type > &scratchBuffer, const buffer_type &buffer, UInt64 offset=0) const =0 |
virtual void | buildAccelerationStructure (top_level_acceleration_structure_type &tlas, const SharedPtr< const buffer_type > &scratchBuffer, const buffer_type &buffer, UInt64 offset=0) const =0 |
virtual void | updateAccelerationStructure (bottom_level_acceleration_structure_type &blas, const SharedPtr< const buffer_type > &scratchBuffer, const buffer_type &buffer, UInt64 offset=0) const =0 |
virtual void | updateAccelerationStructure (top_level_acceleration_structure_type &tlas, const SharedPtr< const buffer_type > &scratchBuffer, const buffer_type &buffer, UInt64 offset=0) const =0 |
virtual void | copyAccelerationStructure (const bottom_level_acceleration_structure_type &from, const bottom_level_acceleration_structure_type &to, bool compress=false) const noexcept=0 |
virtual void | copyAccelerationStructure (const top_level_acceleration_structure_type &from, const top_level_acceleration_structure_type &to, bool compress=false) const noexcept=0 |
virtual void | traceRays (UInt32 width, UInt32 height, UInt32 depth, const ShaderBindingTableOffsets &offsets, const buffer_type &rayGenerationShaderBindingTable, const buffer_type *missShaderBindingTable, const buffer_type *hitShaderBindingTable, const buffer_type *callableShaderBindingTable) const noexcept=0 |
void | traceRays (const Vector3u &dimensions, const ShaderBindingTableOffsets &offsets, const buffer_type &rayGenerationShaderBindingTable, const buffer_type *missShaderBindingTable, const buffer_type *hitShaderBindingTable, const buffer_type *callableShaderBindingTable) const noexcept |
SharedPtr< const ICommandQueue > | queue () const noexcept |
Gets a pointer to the command queue that this command buffer was allocated from or nullptr , if the queue has already been released. | |
virtual void | dispatch (const Vector3u &threadGroupCount) const noexcept=0 |
Executes a compute shader. | |
void | dispatch (UInt32 x, UInt32 y, UInt32 z) const noexcept |
Executes a compute shader. | |
void | dispatchIndirect (const IBuffer &batchBuffer, UInt32 batchCount, UInt64 offset=0) const noexcept |
Executes a set of indirect dispatches. | |
virtual void | dispatchMesh (const Vector3u &threadGroupCount) const noexcept=0 |
Executes a mesh shader pipeline. | |
void | dispatchMesh (UInt32 x, UInt32 y, UInt32 z) const noexcept |
Executes a mesh shader pipeline. | |
virtual void | draw (UInt32 vertices, UInt32 instances=1, UInt32 firstVertex=0, UInt32 firstInstance=0) const noexcept=0 |
Draws a number of vertices from the currently bound vertex buffer. | |
void | draw (const IVertexBuffer &vertexBuffer, UInt32 instances=1, UInt32 firstVertex=0, UInt32 firstInstance=0) const |
Draws all vertices from the vertex buffer provided in vertexBuffer . | |
void | drawIndirect (const IBuffer &batchBuffer, UInt32 batchCount, UInt64 offset=0) const noexcept |
Executes a set of indirect non-indexed draw calls. | |
void | drawIndirect (const IBuffer &batchBuffer, const IBuffer &countBuffer, UInt64 offset=0, UInt64 countOffset=0, UInt32 maxBatches=std::numeric_limits< UInt32 >::max()) const noexcept |
Executes a set of indirect non-indexed draw calls. | |
virtual void | drawIndexed (UInt32 indices, UInt32 instances=1, UInt32 firstIndex=0, Int32 vertexOffset=0, UInt32 firstInstance=0) const noexcept=0 |
Draws the currently bound vertex buffer with a set of indices from the currently bound index buffer. | |
void | drawIndexed (const IIndexBuffer &indexBuffer, UInt32 instances=1, UInt32 firstIndex=0, Int32 vertexOffset=0, UInt32 firstInstance=0) const |
Draws the currently bound vertex buffer using the index buffer provided in indexBuffer . | |
void | drawIndexed (const IVertexBuffer &vertexBuffer, const IIndexBuffer &indexBuffer, UInt32 instances=1, UInt32 firstIndex=0, Int32 vertexOffset=0, UInt32 firstInstance=0) const |
Draws the vertex buffer provided by vertexBuffer using the index buffer, provided by indexBuffer . | |
void | drawIndexedIndirect (const IBuffer &batchBuffer, UInt32 batchCount, UInt64 offset=0) const noexcept |
Executes a set of indirect indexed draw calls. | |
void | drawIndexedIndirect (const IBuffer &batchBuffer, const IBuffer &countBuffer, UInt64 offset=0, UInt64 countOffset=0, UInt32 maxBatches=std::numeric_limits< UInt32 >::max()) const noexcept |
Executes a set of indirect indexed draw calls. | |
void | barrier (const IBarrier &barrier) const noexcept |
Executes the transitions that have been added to barrier . | |
void | transfer (const IBuffer &source, const IBuffer &target, UInt32 sourceElement=0, UInt32 targetElement=0, UInt32 elements=1) const |
Performs a buffer-to-buffer transfer from source to target . | |
void | transfer (const SharedPtr< const IBuffer > &source, const IBuffer &target, UInt32 sourceElement=0, UInt32 targetElement=0, UInt32 elements=1) const |
Performs a buffer-to-buffer transfer from source to target . | |
void | transfer (const void *const data, size_t size, const IBuffer &target, UInt32 targetElement=0, UInt32 elements=1) const |
Performs a buffer-to-buffer transfer from a temporary buffer into target . | |
void | transfer (Span< const void *const > data, size_t elementSize, const IBuffer &target, UInt32 targetElement=0) const |
Performs a buffer-to-buffer transfer from a temporary buffer into target . | |
void | transfer (const IBuffer &source, const IImage &target, UInt32 sourceElement=0, UInt32 firstSubresource=0, UInt32 elements=1) const |
Performs a buffer-to-image transfer from source to target . | |
void | transfer (const SharedPtr< const IBuffer > &source, const IImage &target, UInt32 sourceElement=0, UInt32 firstSubresource=0, UInt32 elements=1) const |
Performs a buffer-to-image transfer from source to target . | |
void | transfer (const void *const data, size_t size, const IImage &target, UInt32 subresource=0) const |
Performs a buffer-to-buffer transfer from a temporary buffer into target . | |
void | transfer (Span< const void *const > data, size_t elementSize, const IImage &target, UInt32 firstSubresource=0, UInt32 elements=1) const |
Performs a buffer-to-buffer transfer from a temporary buffer into target . | |
void | transfer (const IImage &source, const IImage &target, UInt32 sourceSubresource=0, UInt32 targetSubresource=0, UInt32 subresources=1) const |
Performs an image-to-image transfer from source to target . | |
void | transfer (const SharedPtr< const IImage > &source, const IImage &target, UInt32 sourceSubresource=0, UInt32 targetSubresource=0, UInt32 subresources=1) const |
Performs an image-to-image transfer from source to target . | |
void | transfer (const IImage &source, const IBuffer &target, UInt32 firstSubresource=0, UInt32 targetElement=0, UInt32 subresources=1) const |
Performs an image-to-buffer transfer from source to target . | |
void | transfer (const SharedPtr< const IImage > &source, const IBuffer &target, UInt32 firstSubresource=0, UInt32 targetElement=0, UInt32 subresources=1) const |
Performs an image-to-buffer transfer from source to target . | |
void | bind (const IDescriptorSet &descriptorSet) const |
Binds the provided descriptor to the last pipeline that was used by the command buffer. | |
template<typename TSelf , typename T > requires std::derived_from<T, IDescriptorSet> | |
void | bind (this const TSelf &self, std::initializer_list< const T * > descriptorSets) |
Binds an arbitrary input range of descriptor sets to the last pipeline that was used by the command buffer. | |
template<typename TSelf > requires std::derived_from<std::remove_cv_t<std::remove_pointer_t<std::iter_value_t<std::ranges::iterator_t<std::remove_cv_t<std::remove_reference_t<decltype(descriptorSets)>>>>>>, IDescriptorSet> | |
void | bind (this const TSelf &self, std::ranges::input_range auto &&descriptorSets) |
Binds an arbitrary input range of descriptor sets to the last pipeline that was used by the command buffer. | |
void | bind (Span< const IDescriptorSet * > descriptorSets) const |
Binds an arbitrary input range of descriptor sets to the last pipeline that was used by the command buffer. | |
void | bind (const IDescriptorSet &descriptorSet, const IPipeline &pipeline) const |
Binds the provided descriptor set to the provided pipeline. | |
template<typename TSelf , typename T > | |
void | bind (this const TSelf &self, std::initializer_list< const T * > descriptorSets, const typename TSelf::pipeline_type &pipeline) |
Binds an arbitrary input range of descriptor sets to the last pipeline that was used by the command buffer. | |
template<typename TSelf > requires std::derived_from<std::remove_cv_t<std::remove_pointer_t<std::iter_value_t<std::ranges::iterator_t<std::remove_cv_t<std::remove_reference_t<decltype(descriptorSets)>>>>>>, IDescriptorSet> | |
void | bind (this const TSelf &self, std::ranges::input_range auto &&descriptorSets, const typename TSelf::pipeline_type &pipeline) |
Binds an arbitrary input range of descriptor sets to the provided pipeline. | |
void | bind (Span< const IDescriptorSet * > descriptorSets, const IPipeline &pipeline) const |
Binds an arbitrary input range of descriptor sets to the provided pipeline. | |
void | bind (const IVertexBuffer &buffer) const |
Binds a vertex buffer to the pipeline. | |
void | bind (const IIndexBuffer &buffer) const |
Binds a index buffer to the pipeline. | |
void | use (const IPipeline &pipeline) const noexcept |
Sets the active pipeline state. | |
void | pushConstants (const IPushConstantsLayout &layout, const void *const memory) const |
Pushes a block of memory into the push constants backing memory. | |
void | buildAccelerationStructure (IBottomLevelAccelerationStructure &blas, const SharedPtr< const IBuffer > &scratchBuffer, const IBuffer &buffer, UInt64 offset=0) const |
Builds a bottom-level acceleration structure. | |
void | buildAccelerationStructure (ITopLevelAccelerationStructure &tlas, const SharedPtr< const IBuffer > &scratchBuffer, const IBuffer &buffer, UInt64 offset=0) const |
Builds a top-level acceleration structure. | |
void | updateAccelerationStructure (IBottomLevelAccelerationStructure &blas, const SharedPtr< const IBuffer > &scratchBuffer, const IBuffer &buffer, UInt64 offset=0) const |
Updates a bottom-level acceleration structure. | |
void | updateAccelerationStructure (ITopLevelAccelerationStructure &tlas, const SharedPtr< const IBuffer > &scratchBuffer, const IBuffer &buffer, UInt64 offset=0) const |
Updates a top-level acceleration structure. | |
void | copyAccelerationStructure (const IBottomLevelAccelerationStructure &from, const IBottomLevelAccelerationStructure &to, bool compress=false) const noexcept |
Copies the acceleration structure from into the acceleration structure to . | |
void | copyAccelerationStructure (const ITopLevelAccelerationStructure &from, const ITopLevelAccelerationStructure &to, bool compress=false) const noexcept |
Copies the acceleration structure from into the acceleration structure to . | |
![]() | |
~ICommandBuffer () noexcept override=default | |
virtual void | begin () const =0 |
Sets the command buffer into recording state, so that it can receive command that should be submitted to the parent CommandQueue. | |
virtual void | end () const =0 |
Ends recording commands on the command buffer. | |
virtual bool | isSecondary () const noexcept=0 |
Returns true , if the command buffer is a secondary command buffer, or false otherwise. | |
virtual void | track (SharedPtr< const IBuffer > buffer) const =0 |
Sets up tracking for a buffer, so that it will not be destroyed until the command buffer has been executed. | |
virtual void | track (SharedPtr< const IImage > image) const =0 |
Sets up tracking for an image, so that it will not be destroyed until the command buffer has been executed. | |
virtual void | track (SharedPtr< const ISampler > sampler) const =0 |
Sets up tracking for a sampler state, so that it will not be destroyed until the command buffer has been executed. | |
SharedPtr< const ICommandQueue > | queue () const noexcept |
Gets a pointer to the command queue that this command buffer was allocated from or nullptr , if the queue has already been released. | |
UniquePtr< IBarrier > | makeBarrier (PipelineStage syncBefore, PipelineStage syncAfter) const |
Creates a new barrier instance. | |
void | barrier (const IBarrier &barrier) const noexcept |
Executes the transitions that have been added to barrier . | |
void | transfer (const IBuffer &source, const IBuffer &target, UInt32 sourceElement=0, UInt32 targetElement=0, UInt32 elements=1) const |
Performs a buffer-to-buffer transfer from source to target . | |
void | transfer (const SharedPtr< const IBuffer > &source, const IBuffer &target, UInt32 sourceElement=0, UInt32 targetElement=0, UInt32 elements=1) const |
Performs a buffer-to-buffer transfer from source to target . | |
void | transfer (const void *const data, size_t size, const IBuffer &target, UInt32 targetElement=0, UInt32 elements=1) const |
Performs a buffer-to-buffer transfer from a temporary buffer into target . | |
void | transfer (Span< const void *const > data, size_t elementSize, const IBuffer &target, UInt32 targetElement=0) const |
Performs a buffer-to-buffer transfer from a temporary buffer into target . | |
void | transfer (const IBuffer &source, const IImage &target, UInt32 sourceElement=0, UInt32 firstSubresource=0, UInt32 elements=1) const |
Performs a buffer-to-image transfer from source to target . | |
void | transfer (const SharedPtr< const IBuffer > &source, const IImage &target, UInt32 sourceElement=0, UInt32 firstSubresource=0, UInt32 elements=1) const |
Performs a buffer-to-image transfer from source to target . | |
void | transfer (const void *const data, size_t size, const IImage &target, UInt32 subresource=0) const |
Performs a buffer-to-buffer transfer from a temporary buffer into target . | |
void | transfer (Span< const void *const > data, size_t elementSize, const IImage &target, UInt32 firstSubresource=0, UInt32 elements=1) const |
Performs a buffer-to-buffer transfer from a temporary buffer into target . | |
void | transfer (const IImage &source, const IImage &target, UInt32 sourceSubresource=0, UInt32 targetSubresource=0, UInt32 subresources=1) const |
Performs an image-to-image transfer from source to target . | |
void | transfer (const SharedPtr< const IImage > &source, const IImage &target, UInt32 sourceSubresource=0, UInt32 targetSubresource=0, UInt32 subresources=1) const |
Performs an image-to-image transfer from source to target . | |
void | transfer (const IImage &source, const IBuffer &target, UInt32 firstSubresource=0, UInt32 targetElement=0, UInt32 subresources=1) const |
Performs an image-to-buffer transfer from source to target . | |
void | transfer (const SharedPtr< const IImage > &source, const IBuffer &target, UInt32 firstSubresource=0, UInt32 targetElement=0, UInt32 subresources=1) const |
Performs an image-to-buffer transfer from source to target . | |
void | use (const IPipeline &pipeline) const noexcept |
Sets the active pipeline state. | |
void | bind (const IDescriptorSet &descriptorSet) const |
Binds the provided descriptor to the last pipeline that was used by the command buffer. | |
template<typename TSelf , typename T > requires std::derived_from<T, IDescriptorSet> | |
void | bind (this const TSelf &self, std::initializer_list< const T * > descriptorSets) |
Binds an arbitrary input range of descriptor sets to the last pipeline that was used by the command buffer. | |
template<typename TSelf > requires std::derived_from<std::remove_cv_t<std::remove_pointer_t<std::iter_value_t<std::ranges::iterator_t<std::remove_cv_t<std::remove_reference_t<decltype(descriptorSets)>>>>>>, IDescriptorSet> | |
void | bind (this const TSelf &self, std::ranges::input_range auto &&descriptorSets) |
Binds an arbitrary input range of descriptor sets to the last pipeline that was used by the command buffer. | |
void | bind (Span< const IDescriptorSet * > descriptorSets) const |
Binds an arbitrary input range of descriptor sets to the last pipeline that was used by the command buffer. | |
void | bind (const IDescriptorSet &descriptorSet, const IPipeline &pipeline) const |
Binds the provided descriptor set to the provided pipeline. | |
template<typename TSelf , typename T > | |
void | bind (this const TSelf &self, std::initializer_list< const T * > descriptorSets, const typename TSelf::pipeline_type &pipeline) |
Binds an arbitrary input range of descriptor sets to the last pipeline that was used by the command buffer. | |
template<typename TSelf > requires std::derived_from<std::remove_cv_t<std::remove_pointer_t<std::iter_value_t<std::ranges::iterator_t<std::remove_cv_t<std::remove_reference_t<decltype(descriptorSets)>>>>>>, IDescriptorSet> | |
void | bind (this const TSelf &self, std::ranges::input_range auto &&descriptorSets, const typename TSelf::pipeline_type &pipeline) |
Binds an arbitrary input range of descriptor sets to the provided pipeline. | |
void | bind (Span< const IDescriptorSet * > descriptorSets, const IPipeline &pipeline) const |
Binds an arbitrary input range of descriptor sets to the provided pipeline. | |
void | bind (const IVertexBuffer &buffer) const |
Binds a vertex buffer to the pipeline. | |
void | bind (const IIndexBuffer &buffer) const |
Binds a index buffer to the pipeline. | |
void | dispatch (UInt32 x, UInt32 y, UInt32 z) const noexcept |
Executes a compute shader. | |
void | dispatchIndirect (const IBuffer &batchBuffer, UInt32 batchCount, UInt64 offset=0) const noexcept |
Executes a set of indirect dispatches. | |
void | dispatchMesh (UInt32 x, UInt32 y, UInt32 z) const noexcept |
Executes a mesh shader pipeline. | |
void | dispatchMeshIndirect (const IBuffer &batchBuffer, UInt32 batchCount, UInt64 offset=0) const noexcept |
Executes a set of indirect mesh shader dispatches. | |
void | dispatchMeshIndirect (const IBuffer &batchBuffer, const IBuffer &countBuffer, UInt64 offset=0, UInt64 countOffset=0, UInt32 maxBatches=std::numeric_limits< UInt32 >::max()) const noexcept |
Executes a set of indirect mesh shader dispatches. | |
void | traceRays (UInt32 width, UInt32 height, UInt32 depth, const ShaderBindingTableOffsets &offsets, const IBuffer &rayGenerationShaderBindingTable, const IBuffer *missShaderBindingTable=nullptr, const IBuffer *hitShaderBindingTable=nullptr, const IBuffer *callableShaderBindingTable=nullptr) const noexcept |
Executes a query on a ray-tracing pipeline. | |
void | traceRays (const Vector3u &dimensions, const ShaderBindingTableOffsets &offsets, const IBuffer &rayGenerationShaderBindingTable, const IBuffer *missShaderBindingTable=nullptr, const IBuffer *hitShaderBindingTable=nullptr, const IBuffer *callableShaderBindingTable=nullptr) const noexcept |
Executes a query on a ray-tracing pipeline. | |
void | draw (const IVertexBuffer &vertexBuffer, UInt32 instances=1, UInt32 firstVertex=0, UInt32 firstInstance=0) const |
Draws all vertices from the vertex buffer provided in vertexBuffer . | |
void | drawIndirect (const IBuffer &batchBuffer, UInt32 batchCount, UInt64 offset=0) const noexcept |
Executes a set of indirect non-indexed draw calls. | |
void | drawIndirect (const IBuffer &batchBuffer, const IBuffer &countBuffer, UInt64 offset=0, UInt64 countOffset=0, UInt32 maxBatches=std::numeric_limits< UInt32 >::max()) const noexcept |
Executes a set of indirect non-indexed draw calls. | |
void | drawIndexed (const IIndexBuffer &indexBuffer, UInt32 instances=1, UInt32 firstIndex=0, Int32 vertexOffset=0, UInt32 firstInstance=0) const |
Draws the currently bound vertex buffer using the index buffer provided in indexBuffer . | |
void | drawIndexed (const IVertexBuffer &vertexBuffer, const IIndexBuffer &indexBuffer, UInt32 instances=1, UInt32 firstIndex=0, Int32 vertexOffset=0, UInt32 firstInstance=0) const |
Draws the vertex buffer provided by vertexBuffer using the index buffer, provided by indexBuffer . | |
void | drawIndexedIndirect (const IBuffer &batchBuffer, UInt32 batchCount, UInt64 offset=0) const noexcept |
Executes a set of indirect indexed draw calls. | |
void | drawIndexedIndirect (const IBuffer &batchBuffer, const IBuffer &countBuffer, UInt64 offset=0, UInt64 countOffset=0, UInt32 maxBatches=std::numeric_limits< UInt32 >::max()) const noexcept |
Executes a set of indirect indexed draw calls. | |
void | pushConstants (const IPushConstantsLayout &layout, const void *const memory) const |
Pushes a block of memory into the push constants backing memory. | |
virtual void | setViewports (Span< const IViewport * > viewports) const =0 |
Sets the viewports used for the subsequent draw calls. | |
virtual void | setViewports (const IViewport *viewport) const =0 |
Sets the viewport used for the subsequent draw calls. | |
virtual void | setScissors (Span< const IScissor * > scissors) const =0 |
Sets the scissor rectangles used for the subsequent draw calls. | |
virtual void | setScissors (const IScissor *scissor) const =0 |
Sets the scissor rectangle used for the subsequent draw calls. | |
virtual void | setBlendFactors (const Vector4f &blendFactors) const noexcept=0 |
Sets the blend factors for the subsequent draw calls. | |
virtual void | setStencilRef (UInt32 stencilRef) const noexcept=0 |
Sets the stencil reference for the subsequent draw calls. | |
virtual UInt64 | submit () const =0 |
Submits the command buffer to parent command. | |
virtual void | writeTimingEvent (const SharedPtr< const TimingEvent > &timingEvent) const =0 |
Writes the current GPU time stamp value for the timing event. | |
void | execute (const SharedPtr< const ICommandBuffer > &commandBuffer) const |
Executes a secondary command buffer/bundle. | |
void | execute (Enumerable< SharedPtr< const ICommandBuffer > > commandBuffers) const |
Executes a series of secondary command buffers/bundles. | |
void | buildAccelerationStructure (IBottomLevelAccelerationStructure &blas, const SharedPtr< const IBuffer > &scratchBuffer, const IBuffer &buffer, UInt64 offset=0) const |
Builds a bottom-level acceleration structure. | |
void | buildAccelerationStructure (ITopLevelAccelerationStructure &tlas, const SharedPtr< const IBuffer > &scratchBuffer, const IBuffer &buffer, UInt64 offset=0) const |
Builds a top-level acceleration structure. | |
void | updateAccelerationStructure (IBottomLevelAccelerationStructure &blas, const SharedPtr< const IBuffer > &scratchBuffer, const IBuffer &buffer, UInt64 offset=0) const |
Updates a bottom-level acceleration structure. | |
void | updateAccelerationStructure (ITopLevelAccelerationStructure &tlas, const SharedPtr< const IBuffer > &scratchBuffer, const IBuffer &buffer, UInt64 offset=0) const |
Updates a top-level acceleration structure. | |
void | copyAccelerationStructure (const IBottomLevelAccelerationStructure &from, const IBottomLevelAccelerationStructure &to, bool compress=false) const noexcept |
Copies the acceleration structure from into the acceleration structure to . | |
void | copyAccelerationStructure (const ITopLevelAccelerationStructure &from, const ITopLevelAccelerationStructure &to, bool compress=false) const noexcept |
Copies the acceleration structure from into the acceleration structure to . | |
![]() | |
virtual | ~SharedObject () noexcept=default |
Destroys the shared object. | |
template<typename TSelf > | |
auto | shared_from_this (this TSelf &&self) noexcept |
Returns a shared pointer to the current object instance. | |
template<typename TSelf > | |
auto | weak_from_this (this TSelf &&self) noexcept -> WeakPtr< std::remove_reference_t< TSelf > > |
Returns a weak pointer to the current object instance. | |
Public Attributes | |
friend | TCommandBuffer |
Additional Inherited Members | |
![]() | |
ICommandBuffer () noexcept=default | |
ICommandBuffer (ICommandBuffer &&) noexcept=default | |
ICommandBuffer (const ICommandBuffer &)=default | |
ICommandBuffer & | operator= (const ICommandBuffer &)=default |
ICommandBuffer & | operator= (ICommandBuffer &&) noexcept=default |
virtual void | releaseSharedState () const =0 |
Called by the parent command queue to signal that the command buffer should release it's shared state. | |
![]() | |
SharedObject () noexcept=default | |
Initializes a new shared object. | |
SharedObject (SharedObject &&) noexcept=default | |
SharedObject (const SharedObject &)=default | |
SharedObject & | operator= (SharedObject &&) noexcept=default |
SharedObject & | operator= (const SharedObject &)=default |
![]() | |
template<typename T , typename... TArgs> | |
static auto | create (TArgs &&... args) -> SharedPtr< T > |
Generic factory method used to create instances of the shared object. | |
Represents a command buffer, that buffers commands that should be submitted to a CommandQueue.
TCommandBuffer | The type of the command buffer itself. Must inherit from CommandBuffer. |
TBuffer | The generic buffer type. Must implement IBuffer. |
TVertexBuffer | The vertex buffer type. Must implement VertexBuffer. |
TIndexBuffer | The index buffer type. Must implement IndexBuffer. |
TImage | The generic image type. Must implement IImage. |
TBarrier | The barrier type. Must implement Barrier. |
TPipeline | The common pipeline interface type. Must be derived from Pipeline. |
TBLAS | The type of the bottom-level acceleration structure. Must implement IBottomLevelAccelerationStructure. |
TTLAS | The type of the top-level acceleration structure. Must implement ITopLevelAccelerationStructure. |
using LiteFX::Rendering::CommandBuffer< TCommandBuffer, TBuffer, TVertexBuffer, TIndexBuffer, TImage, TBarrier, TPipeline, TBLAS, TTLAS >::barrier_type = TBarrier |
using LiteFX::Rendering::CommandBuffer< TCommandBuffer, TBuffer, TVertexBuffer, TIndexBuffer, TImage, TBarrier, TPipeline, TBLAS, TTLAS >::bottom_level_acceleration_structure_type = TBLAS |
using LiteFX::Rendering::CommandBuffer< TCommandBuffer, TBuffer, TVertexBuffer, TIndexBuffer, TImage, TBarrier, TPipeline, TBLAS, TTLAS >::buffer_type = TBuffer |
using LiteFX::Rendering::CommandBuffer< TCommandBuffer, TBuffer, TVertexBuffer, TIndexBuffer, TImage, TBarrier, TPipeline, TBLAS, TTLAS >::command_buffer_type = TCommandBuffer |
using LiteFX::Rendering::CommandBuffer< TCommandBuffer, TBuffer, TVertexBuffer, TIndexBuffer, TImage, TBarrier, TPipeline, TBLAS, TTLAS >::descriptor_set_layout_type = pipeline_layout_type::descriptor_set_layout_type |
using LiteFX::Rendering::CommandBuffer< TCommandBuffer, TBuffer, TVertexBuffer, TIndexBuffer, TImage, TBarrier, TPipeline, TBLAS, TTLAS >::descriptor_set_type = descriptor_set_layout_type::descriptor_set_type |
using LiteFX::Rendering::CommandBuffer< TCommandBuffer, TBuffer, TVertexBuffer, TIndexBuffer, TImage, TBarrier, TPipeline, TBLAS, TTLAS >::image_type = TImage |
using LiteFX::Rendering::CommandBuffer< TCommandBuffer, TBuffer, TVertexBuffer, TIndexBuffer, TImage, TBarrier, TPipeline, TBLAS, TTLAS >::index_buffer_type = TIndexBuffer |
using LiteFX::Rendering::CommandBuffer< TCommandBuffer, TBuffer, TVertexBuffer, TIndexBuffer, TImage, TBarrier, TPipeline, TBLAS, TTLAS >::pipeline_layout_type = pipeline_type::pipeline_layout_type |
using LiteFX::Rendering::CommandBuffer< TCommandBuffer, TBuffer, TVertexBuffer, TIndexBuffer, TImage, TBarrier, TPipeline, TBLAS, TTLAS >::pipeline_type = TPipeline |
using LiteFX::Rendering::CommandBuffer< TCommandBuffer, TBuffer, TVertexBuffer, TIndexBuffer, TImage, TBarrier, TPipeline, TBLAS, TTLAS >::push_constants_layout_type = pipeline_layout_type::push_constants_layout_type |
using LiteFX::Rendering::CommandBuffer< TCommandBuffer, TBuffer, TVertexBuffer, TIndexBuffer, TImage, TBarrier, TPipeline, TBLAS, TTLAS >::top_level_acceleration_structure_type = TTLAS |
using LiteFX::Rendering::CommandBuffer< TCommandBuffer, TBuffer, TVertexBuffer, TIndexBuffer, TImage, TBarrier, TPipeline, TBLAS, TTLAS >::vertex_buffer_type = TVertexBuffer |
|
overridedefaultnoexcept |
|
pure virtualnoexcept |
|
inlinenoexcept |
Executes the transitions that have been added to barrier .
Calling this method will also update the resource states of each resource within the barrier. However, the actual state of the resource does not change until the barrier is executed on the command queue. Keep this in mind when inserting multiple barriers from different threads or in different command buffers, which may not be executed in order. You might have to manually synchronize barrier execution.
barrier | The barrier containing the transitions to perform. |
|
pure virtual |
|
pure virtual |
|
inline |
Binds the provided descriptor to the last pipeline that was used by the command buffer.
descriptorSet | The descriptor set to bind. |
RuntimeException | Thrown, if no pipeline has been used before attempting to bind the descriptor set. |
|
inline |
Binds the provided descriptor set to the provided pipeline.
descriptorSet | The descriptor set to bind. |
pipeline | The pipeline to bind the descriptor set to. |
|
inline |
Binds a index buffer to the pipeline.
After binding the index buffer, the next call to drawIndexed will read from it, until another index buffer is bound.
buffer | The index buffer to bind to the pipeline. |
|
pure virtualnoexcept |
|
inline |
Binds a vertex buffer to the pipeline.
After binding the vertex buffer, the next call to draw or drawIndexed will read from it, until another vertex buffer is bound.
buffer | The vertex buffer to bind to the pipeline. |
|
pure virtualnoexcept |
|
pure virtual |
|
pure virtual |
|
inline |
Binds an arbitrary input range of descriptor sets to the last pipeline that was used by the command buffer.
Note that if an element of descriptorSets is nullptr
, it will be ignored.
descriptorSets | The pointers to the descriptor sets to bind. |
|
inline |
Binds an arbitrary input range of descriptor sets to the provided pipeline.
Note that if an element of descriptorSets is nullptr
, it will be ignored.
descriptorSets | The pointers to the descriptor sets to bind. |
pipeline | The pipeline to bind the descriptor set to. |
|
inline |
Binds an arbitrary input range of descriptor sets to the last pipeline that was used by the command buffer.
Note that if an element of descriptorSets is nullptr
, it will be ignored.
T | The type of the descriptor sets. |
descriptorSets | The pointers to the descriptor sets to bind. |
RuntimeException | Thrown, if no pipeline has been used before attempting to bind the descriptor set. |
|
inline |
Binds an arbitrary input range of descriptor sets to the last pipeline that was used by the command buffer.
Note that if an element of descriptorSets is nullptr
, it will be ignored.
T | The type of the descriptor sets. |
descriptorSets | The pointers to the descriptor sets to bind. |
pipeline | The pipeline to bind the descriptor set to. |
RuntimeException | Thrown, if no pipeline has been used before attempting to bind the descriptor set. |
|
inline |
Binds an arbitrary input range of descriptor sets to the last pipeline that was used by the command buffer.
Note that if an element of descriptorSets is nullptr
, it will be ignored.
descriptorSets | The pointers to the descriptor sets to bind. |
RuntimeException | Thrown, if no pipeline has been used before attempting to bind the descriptor set. |
|
inline |
Binds an arbitrary input range of descriptor sets to the provided pipeline.
Note that if an element of descriptorSets is nullptr
, it will be ignored.
descriptorSets | The pointers to the descriptor sets to bind. |
pipeline | The pipeline to bind the descriptor set to. |
|
pure virtual |
|
inline |
Builds a bottom-level acceleration structure.
This method is only supported if the GraphicsDeviceFeature::RayTracing feature is enabled.
blas | The bottom-level acceleration structure to build. |
scratchBuffer | The scratch buffer to use for building the acceleration structure. |
buffer | The buffer that contains the acceleration structure after the build. |
offset | The offset into buffer at which the acceleration structure gets stored after the build. |
ArgumentNotInitializedException | Thrown, if the provided scratchBuffer is not initialized. |
|
inline |
Builds a top-level acceleration structure.
This method is only supported if the GraphicsDeviceFeature::RayTracing feature is enabled.
tlas | The top-level acceleration structure to build. |
scratchBuffer | The scratch buffer to use for building the acceleration structure. |
buffer | The buffer that contains the acceleration structure after the build. |
offset | The offset into buffer at which the acceleration structure gets stored after the build. |
ArgumentNotInitializedException | Thrown, if the provided scratchBuffer is not initialized. |
|
pure virtual |
|
pure virtualnoexcept |
|
inlinenoexcept |
Copies the acceleration structure from into the acceleration structure to .
Prefer calling IBottomLevelAccelerationStructure::copy over directly issuing copy commands on a command buffer, as this will make sure that the destination buffer will be properly allocated and contains enough memory to store the copy. Only issue copies on the command buffer directly, if you want to retain the destination buffer and know for certain, that it contains a sufficient amount of memory.
This method is only supported if the GraphicsDeviceFeature::RayTracing feature is enabled.
from | The source acceleration structure to copy from. |
to | The destination acceleration structure to copy to. |
compress | If set to true , the acceleration structure will be compressed. |
|
inlinenoexcept |
Copies the acceleration structure from into the acceleration structure to .
Prefer calling ITopLevelAccelerationStructure::copy over directly issuing copy commands on a command buffer, as this will make sure that the destination buffer will be properly allocated and contains enough memory to store the copy. Only issue copies on the command buffer directly, if you want to retain the destination buffer and know for certain, that it contains a sufficient amount of memory.
This method is only supported if the GraphicsDeviceFeature::RayTracing feature is enabled.
from | The source acceleration structure to copy from. |
to | The destination acceleration structure to copy to. |
compress | If set to true , the acceleration structure will be compressed. |
|
pure virtualnoexcept |
|
virtualnoexcept |
Executes a compute shader.
threadCount | The number of thread groups per dimension. |
Implements LiteFX::Rendering::ICommandBuffer.
Reimplemented in LiteFX::Rendering::Backends::DirectX12CommandBuffer, and LiteFX::Rendering::Backends::VulkanCommandBuffer.
|
inlinenoexcept |
Executes a compute shader.
x | The number of thread groups along the x dimension. |
y | The number of thread groups along the y dimension. |
z | The number of thread groups along the z dimension. |
|
pure virtualnoexcept |
|
inlinenoexcept |
Executes a set of indirect dispatches.
batchBuffer | The buffer that contains the batches. |
batchCount | The number of batches in the buffer to execute. |
offset | The offset (in bytes) to the first batch in the batchBuffer . |
|
virtualnoexcept |
Executes a mesh shader pipeline.
This method is only supported if the GraphicsDeviceFeature::MeshShaders feature is enabled.
threadCount | The number of thread groups per dimension. |
Implements LiteFX::Rendering::ICommandBuffer.
Reimplemented in LiteFX::Rendering::Backends::DirectX12CommandBuffer, and LiteFX::Rendering::Backends::VulkanCommandBuffer.
|
inlinenoexcept |
Executes a mesh shader pipeline.
This method is only supported if the GraphicsDeviceFeature::MeshShaders feature is enabled.
x | The number of thread groups along the x dimension. |
y | The number of thread groups along the y dimension. |
z | The number of thread groups along the z dimension. |
|
pure virtualnoexcept |
|
pure virtualnoexcept |
|
inline |
Draws all vertices from the vertex buffer provided in vertexBuffer .
This helper method binds the vertex buffer and issues a draw command for all vertices.
vertexBuffer | The vertex buffer to draw from. |
instances | The number of instances to draw. |
firstVertex | The index of the first vertex to start drawing from. |
firstInstance | The index of the first instance to draw. |
|
inlinevirtual |
|
virtualnoexcept |
Draws a number of vertices from the currently bound vertex buffer.
vertices | The number of vertices to draw. |
instances | The number of instances to draw. |
firstVertex | The index of the first vertex to start drawing from. |
firstInstance | The index of the first instance to draw. |
Implements LiteFX::Rendering::ICommandBuffer.
Reimplemented in LiteFX::Rendering::Backends::DirectX12CommandBuffer, and LiteFX::Rendering::Backends::VulkanCommandBuffer.
|
inline |
Draws the currently bound vertex buffer using the index buffer provided in indexBuffer .
This helper method binds the index buffer and issues a draw command for all indices.
indexBuffer | The index buffer to draw with. |
instances | The number of instances to draw. |
firstIndex | The index of the first element of the index buffer to start drawing from. |
vertexOffset | The offset added to each index to find the corresponding vertex. |
firstInstance | The index of the first instance to draw. |
|
inlinevirtual |
|
inline |
Draws the vertex buffer provided by vertexBuffer using the index buffer, provided by indexBuffer .
This helper method binds the provided vertex and index buffers and issues a draw command for all indices.
vertexBuffer | The vertex buffer to draw from. |
indexBuffer | The index buffer to draw with. |
instances | The number of instances to draw. |
firstIndex | The index of the first element of the index buffer to start drawing from. |
vertexOffset | The offset added to each index to find the corresponding vertex. |
firstInstance | The index of the first instance to draw. |
|
inlinevirtual |
|
virtualnoexcept |
Draws the currently bound vertex buffer with a set of indices from the currently bound index buffer.
indices | The number of indices to draw. |
instances | The number of instances to draw. |
firstIndex | The index of the first element of the index buffer to start drawing from. |
vertexOffset | The offset added to each index to find the corresponding vertex. |
firstInstance | The index of the first instance to draw. |
Implements LiteFX::Rendering::ICommandBuffer.
Reimplemented in LiteFX::Rendering::Backends::DirectX12CommandBuffer, and LiteFX::Rendering::Backends::VulkanCommandBuffer.
|
pure virtualnoexcept |
|
pure virtualnoexcept |
|
inlinenoexcept |
Executes a set of indirect indexed draw calls.
batchBuffer | The buffer that contains the batches. |
countBuffer | The buffer that contains the number of batches to execute. |
offset | The offset (in bytes) to the first batch in the batchBuffer . |
countOffset | The offset (in bytes) to the number of batches in the countBuffer . |
maxBatches | The maximum number of batches executed, even if there are more batches in countBuffer . |
|
inlinenoexcept |
Executes a set of indirect indexed draw calls.
batchBuffer | The buffer that contains the batches. |
batchCount | The number of batches in the buffer to execute. |
offset | The offset (in bytes) to the first batch in the batchBuffer . |
|
pure virtualnoexcept |
|
pure virtualnoexcept |
|
inlinenoexcept |
Executes a set of indirect non-indexed draw calls.
batchBuffer | The buffer that contains the batches. |
countBuffer | The buffer that contains the number of batches to execute. |
offset | The offset (in bytes) to the first batch in the batchBuffer . |
countOffset | The offset (in bytes) to the number of batches in the countBuffer . |
maxBatches | The maximum number of batches executed, even if there are more batches in countBuffer . |
|
inlinenoexcept |
Executes a set of indirect non-indexed draw calls.
batchBuffer | The buffer that contains the batches. |
batchCount | The number of batches in the buffer to execute. |
offset | The offset (in bytes) to the first batch in the batchBuffer . |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
inline |
Pushes a block of memory into the push constants backing memory.
layout | The layout of the push constants to update. |
memory | A pointer to the source memory. |
|
pure virtual |
|
inlinenoexcept |
Gets a pointer to the command queue that this command buffer was allocated from or nullptr
, if the queue has already been released.
|
inlinenoexcept |
|
pure virtualnoexcept |
|
pure virtual |
|
pure virtual |
|
inline |
Performs a buffer-to-buffer transfer from source to target .
Note that you have to manually ensure that source and target are in the proper state for transfer operations. You might have to use a IBarrier before starting the transfer.
source | The source buffer to transfer data from. |
target | The target buffer to transfer data to. |
sourceElement | The index of the first element in the source buffer to copy. |
targetElement | The index of the first element in the target buffer to copy to. |
elements | The number of elements to copy from the source buffer into the target buffer. |
ArgumentOutOfRangeException | Thrown, if the number of either the source buffer or the target buffer has not enough elements for the specified elements parameter. |
|
inline |
Performs a buffer-to-image transfer from source to target .
The subresource parameter describes the index of the first sub-resource to copy. Each element gets copied into the subsequent sub-resource, where resources are counted in the following order:
E.g., if 6 elements should be copied to an image with 3 mip-map levels and 3 layers, the elements 0-2 contain the mip-map levels of the first layer, while elements 3-5 contain the three mip-map levels of the second layer. The third layer would not receive any data in this example. If the image format has multiple planes, this procedure would be repeated for each plane, however one buffer element only maps to one sub-resource.
Note that you have to manually ensure that source and target are in the proper state for transfer operations. You might have to use a IBarrier before starting the transfer.
source | The source buffer to transfer data from. |
target | The target image to transfer data to. |
sourceElement | The index of the first element in the source buffer to copy. |
firstSubresource | The index of the first sub-resource of the target image to receive data. |
elements | The number of elements to copy from the source buffer into the target image sub-resources. |
ArgumentOutOfRangeException | Thrown, if the number of either the source buffer or the target buffer has not enough elements for the specified elements parameter. |
|
inline |
Performs an image-to-buffer transfer from source to target .
The firstSubresource parameter describes the index of the first sub-resource to copy. Each element gets copied into the subsequent sub-resource, where resources are counted in the following order:
E.g., if 6 elements should be copied to an image with 3 mip-map levels and 3 layers, the elements 0-2 contain the mip-map levels of the first layer, while elements 3-5 contain the three mip-map levels of the second layer. The third layer would not receive any data in this example. If the image format has multiple planes, this procedure would be repeated for each plane, however one buffer element only maps to one sub-resource.
Note that you have to manually ensure that source and target are in the proper state for transfer operations. You might have to use a IBarrier before starting the transfer.
source | The source image to transfer data from. |
target | The target buffer to transfer data to. |
firstSubresource | The index of the first sub-resource to copy from the source image. |
targetElement | The index of the first target element to receive data. |
subresources | The number of sub-resources to copy. |
ArgumentOutOfRangeException | Thrown, if the number of either the source buffer or the target buffer has not enough elements for the specified elements parameter. |
|
inline |
Performs an image-to-image transfer from source to target .
Note that you have to manually ensure that source and target are in the proper state for transfer operations. You might have to use a IBarrier before starting the transfer.
source | The source image to transfer data from. |
target | The target image to transfer data to. |
sourceSubresource | The index of the first sub-resource to copy from the source image. |
targetSubresource | The image of the first sub-resource in the target image to receive data. |
subresources | The number of sub-resources to copy between the images. |
ArgumentOutOfRangeException | Thrown, if the number of either the source buffer or the target buffer has not enough elements for the specified elements parameter. |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
inline |
Performs a buffer-to-buffer transfer from source to target .
This method takes shared ownership over source , which means that a reference is hold until the parent command queue finished using the command buffer. At this point, the command queue calls releaseSharedState to release all shared references. Note that this is a relaxed constraint. It is only guaranteed, that the queue calls this method at some point after the command buffer has been executed.
Sharing ownership is helpful in situations where you only have a temporary buffer that you do not want to manually keep track of. For example, it makes sense to create a temporary staging buffer and delete it, if the remote resource has been initialized. In such a case, the command buffer can take ownership over the resource to release it after it has been executed.
Note that you have to manually ensure that source and target are in the proper state for transfer operations. You might have to use a IBarrier before starting the transfer.
source | The source buffer to transfer data from. |
target | The target buffer to transfer data to. |
sourceElement | The index of the first element in the source buffer to copy. |
targetElement | The index of the first element in the target buffer to copy to. |
elements | The number of elements to copy from the source buffer into the target buffer. |
ArgumentOutOfRangeException | Thrown, if the number of either the source buffer or the target buffer has not enough elements for the specified elements parameter. |
|
inline |
Performs a buffer-to-image transfer from source to target .
The subresource parameter describes the index of the first sub-resource to copy. Each element gets copied into the subsequent sub-resource, where resources are counted in the following order:
E.g., if 6 elements should be copied to an image with 3 mip-map levels and 3 layers, the elements 0-2 contain the mip-map levels of the first layer, while elements 3-5 contain the three mip-map levels of the second layer. The third layer would not receive any data in this example. If the image format has multiple planes, this procedure would be repeated for each plane, however one buffer element only maps to one sub-resource.
This method takes shared ownership over source , which means that a reference is hold until the parent command queue finished using the command buffer. At this point, the command queue calls releaseSharedState to release all shared references. Note that this is a relaxed constraint. It is only guaranteed, that the queue calls this method at some point after the command buffer has been executed.
Sharing ownership is helpful in situations where you only have a temporary buffer that you do not want to manually keep track of. For example, it makes sense to create a temporary staging buffer and delete it, if the remote resource has been initialized. In such a case, the command buffer can take ownership over the resource to release it after it has been executed.
Note that you have to manually ensure that source and target are in the proper state for transfer operations. You might have to use a IBarrier before starting the transfer.
source | The source buffer to transfer data from. |
target | The target image to transfer data to. |
sourceElement | The index of the first element in the source buffer to copy. |
firstSubresource | The index of the first sub-resource of the target image to receive data. |
elements | The number of elements to copy from the source buffer into the target image sub-resources. |
ArgumentOutOfRangeException | Thrown, if the number of either the source buffer or the target buffer has not enough elements for the specified elements parameter. |
|
inline |
Performs an image-to-buffer transfer from source to target .
The firstSubresource parameter describes the index of the first sub-resource to copy. Each element gets copied into the subsequent sub-resource, where resources are counted in the following order:
E.g., if 6 elements should be copied to an image with 3 mip-map levels and 3 layers, the elements 0-2 contain the mip-map levels of the first layer, while elements 3-5 contain the three mip-map levels of the second layer. The third layer would not receive any data in this example. If the image format has multiple planes, this procedure would be repeated for each plane, however one buffer element only maps to one sub-resource.
This method takes shared ownership over source , which means that a reference is hold until the parent command queue finished using the command buffer. At this point, the command queue calls releaseSharedState to release all shared references. Note that this is a relaxed constraint. It is only guaranteed, that the queue calls this method at some point after the command buffer has been executed.
Sharing ownership is helpful in situations where you only have a temporary buffer that you do not want to manually keep track of. For example, it makes sense to create a temporary staging buffer and delete it, if the remote resource has been initialized. In such a case, the command buffer can take ownership over the resource to release it after it has been executed.
Note that you have to manually ensure that source and target are in the proper state for transfer operations. You might have to use a IBarrier before starting the transfer.
source | The source image to transfer data from. |
target | The target buffer to transfer data to. |
firstSubresource | The index of the first sub-resource to copy from the source image. |
targetElement | The index of the first target element to receive data. |
subresources | The number of sub-resources to copy. |
ArgumentOutOfRangeException | Thrown, if the number of either the source buffer or the target buffer has not enough elements for the specified elements parameter. |
|
inline |
Performs an image-to-image transfer from source to target .
This method takes shared ownership over source , which means that a reference is hold until the parent command queue finished using the command buffer. At this point, the command queue calls releaseSharedState to release all shared references. Note that this is a relaxed constraint. It is only guaranteed, that the queue calls this method at some point after the command buffer has been executed.
Sharing ownership is helpful in situations where you only have a temporary buffer that you do not want to manually keep track of. For example, it makes sense to create a temporary staging buffer and delete it, if the remote resource has been initialized. In such a case, the command buffer can take ownership over the resource to release it after it has been executed.
Note that you have to manually ensure that source and target are in the proper state for transfer operations. You might have to use a IBarrier before starting the transfer.
source | The source image to transfer data from. |
target | The target image to transfer data to. |
sourceSubresource | The index of the first sub-resource to copy from the source image. |
targetSubresource | The image of the first sub-resource in the target image to receive data. |
subresources | The number of sub-resources to copy between the images. |
ArgumentOutOfRangeException | Thrown, if the number of either the source buffer or the target buffer has not enough elements for the specified elements parameter. |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
inline |
Performs a buffer-to-buffer transfer from a temporary buffer into target .
This method creates a temporary buffer and maps data into it, before transferring it into target . A reference of the temporary buffer is stored until the parent command queue finished using the command buffer. At this point, the command queue calls releaseSharedState to release all shared references. Note that this is a relaxed constraint. It is only guaranteed, that the queue calls this method at some point after the command buffer has been executed.
data | The address that marks the beginning of the data to map. |
size | The number of bytes to map. |
target | The target buffer to transfer data to. |
targetElement | The array element to map the data to. |
elements | The number of elements to copy. |
|
inline |
Performs a buffer-to-buffer transfer from a temporary buffer into target .
This method creates a temporary buffer and maps data into it, before transferring it into target . A reference of the temporary buffer is stored until the parent command queue finished using the command buffer. At this point, the command queue calls releaseSharedState to release all shared references. Note that this is a relaxed constraint. It is only guaranteed, that the queue calls this method at some point after the command buffer has been executed.
data | The address that marks the beginning of the data to map. |
size | The number of bytes to map. |
target | The target buffer to transfer data to. |
firstSubresource | The index of the first sub-resource of the target image to receive data. |
elements | The number of elements to copy from the source buffer into the target image sub-resources. |
|
pure virtual |
|
pure virtual |
|
inline |
Performs a buffer-to-buffer transfer from a temporary buffer into target .
This method creates a temporary buffer and maps data into it, before transferring it into target . A reference of the temporary buffer is stored until the parent command queue finished using the command buffer. At this point, the command queue calls releaseSharedState to release all shared references. Note that this is a relaxed constraint. It is only guaranteed, that the queue calls this method at some point after the command buffer has been executed.
data | The addresses that mark the beginning of the element data to map. |
elementSize | The number of bytes to map for each element. |
target | The target buffer to transfer data to. |
targetElement | The first array element to transfer the data to. |
|
inline |
Performs a buffer-to-buffer transfer from a temporary buffer into target .
This method creates a temporary buffer and maps data into it, before transferring it into target . A reference of the temporary buffer is stored until the parent command queue finished using the command buffer. At this point, the command queue calls releaseSharedState to release all shared references. Note that this is a relaxed constraint. It is only guaranteed, that the queue calls this method at some point after the command buffer has been executed.
data | The addresses that mark the beginning of the element data to map. |
elementSize | The number of bytes to map for each element. |
target | The target buffer to transfer data to. |
firstSubresource | The index of the first sub-resource of the target image to receive data. |
elements | The number of elements to copy from the source buffer into the target image sub-resources. |
|
pure virtual |
|
pure virtual |
|
inline |
Updates a bottom-level acceleration structure.
This method is only supported if the GraphicsDeviceFeature::RayTracing feature is enabled.
blas | The bottom-level acceleration structure to build. |
scratchBuffer | The scratch buffer to use for building the acceleration structure. |
buffer | The buffer that contains the acceleration structure after the build. |
offset | The offset into buffer at which the acceleration structure gets stored after the build. |
ArgumentNotInitializedException | Thrown, if the provided scratchBuffer is not initialized. |
|
inline |
Updates a top-level acceleration structure.
This method is only supported if the GraphicsDeviceFeature::RayTracing feature is enabled.
tlas | The top-level acceleration structure to build. |
scratchBuffer | The scratch buffer to use for building the acceleration structure. |
buffer | The buffer that contains the acceleration structure after the build. |
offset | The offset into buffer at which the acceleration structure gets stored after the build. |
ArgumentNotInitializedException | Thrown, if the provided scratchBuffer is not initialized. |
|
pure virtual |
|
inlinenoexcept |
Sets the active pipeline state.
|
pure virtualnoexcept |
friend LiteFX::Rendering::CommandBuffer< TCommandBuffer, TBuffer, TVertexBuffer, TIndexBuffer, TImage, TBarrier, TPipeline, TBLAS, TTLAS >::TCommandBuffer |