LLGL 0.05 Beta
Loading...
Searching...
No Matches
LLGL::CommandBufferTier1 Class Referenceabstract

Extended tier-1 command buffer interface. More...

#include <CommandBufferTier1.h>

Inheritance diagram for LLGL::CommandBufferTier1:
LLGL::CommandBuffer LLGL::RenderSystemChild LLGL::Interface LLGL::NonCopyable

Public Member Functions

virtual void SetShadingRate (ShadingRate shadingRate)=0
 Sets the shading rate for subsequent drawing commands.
virtual void SetShadingRate (ShadingRate shadingRate, ShadingRateOp combinerOpX, ShadingRateOp combinerOpY)=0
 Sets the shading rate for subsequent drawing commands.
virtual void DrawMesh (std::uint32_t numWorkGroupsX, std::uint32_t numWorkGroupsY, std::uint32_t numWorkGroupsZ)=0
 Draws a mesh by dispatching shader work groups for mesh tasks.
virtual void DrawMeshIndirect (Buffer &buffer, std::uint64_t offset, std::uint32_t numCommands, std::uint32_t stride)=0
 Draws an unknown amount of meshes whose draw command arguments are taken from a buffer object.
virtual void DrawMeshIndirect (Buffer &argumentsBuffer, std::uint64_t argumentsOffset, Buffer &countBuffer, std::uint64_t countOffset, std::uint32_t maxNumCommands, std::uint32_t stride)=0
 Draws an unknown amount of meshes whose draw command arguments are taken from a buffer object.
Public Member Functions inherited from LLGL::CommandBuffer
virtual void Begin ()=0
 Begins with the encoding (also referred to as "recording") of this command buffer.
virtual void End ()=0
 Ends the encoding (also referred to as "recording") of this command buffer.
virtual void Execute (CommandBuffer &secondaryCommandBuffer)=0
 Executes the specified secondary command buffer by inlining its commands into this command buffer.
virtual void UpdateBuffer (Buffer &dstBuffer, std::uint64_t dstOffset, const void *data, std::uint64_t dataSize)=0
 Updates the data of the specified buffer during encoding the command buffer.
virtual void CopyBuffer (Buffer &dstBuffer, std::uint64_t dstOffset, Buffer &srcBuffer, std::uint64_t srcOffset, std::uint64_t size)=0
 Encodes a buffer copy command for the specified buffer region.
virtual void CopyBufferFromTexture (Buffer &dstBuffer, std::uint64_t dstOffset, Texture &srcTexture, const TextureRegion &srcRegion, std::uint32_t rowStride=0, std::uint32_t layerStride=0)=0
 Encodes a buffer copy command that blits data from a source texture.
virtual void FillBuffer (Buffer &dstBuffer, std::uint64_t dstOffset, std::uint32_t value, std::uint64_t fillSize=LLGL_WHOLE_SIZE)=0
 Fills the destination buffer with copies of the specified 32-bit value.
virtual void CopyTexture (Texture &dstTexture, const TextureLocation &dstLocation, Texture &srcTexture, const TextureLocation &srcLocation, const Extent3D &extent)=0
 Encodes a texture copy command for the specified texture regions.
virtual void CopyTextureFromBuffer (Texture &dstTexture, const TextureRegion &dstRegion, Buffer &srcBuffer, std::uint64_t srcOffset, std::uint32_t rowStride=0, std::uint32_t layerStride=0)=0
 Encodes a texture copy command that blits data from a source buffer.
virtual void CopyTextureFromFramebuffer (Texture &dstTexture, const TextureRegion &dstRegion, const Offset2D &srcOffset)=0
 Encodes a texture copy command that blits data from the current framebuffer.
virtual void GenerateMips (Texture &texture)=0
 Generates all MIP-maps for the specified texture.
virtual void GenerateMips (Texture &texture, const TextureSubresource &subresource)=0
 Generates a range of MIP-maps for the specified texture.
virtual void SetViewport (const Viewport &viewport)=0
 Sets a single viewport.
virtual void SetViewports (std::uint32_t numViewports, const Viewport *viewports)=0
 Sets an array of viewports.
virtual void SetScissor (const Scissor &scissor)=0
 Sets a single scissor rectangle.
virtual void SetScissors (std::uint32_t numScissors, const Scissor *scissors)=0
 Sets an array of scissor rectangles, but only if the scissor test was enabled in the previously set graphics pipeline (otherwise, this function has no effect).
virtual void SetVertexBuffer (Buffer &buffer)=0
 Sets the specified vertex buffer for subsequent drawing operations.
virtual void SetVertexBuffer (Buffer &buffer, std::uint32_t stride, std::uint64_t offset=0)=0
 Sets the specified vertex buffer for subsequent drawing operations with a new stride and optional base offset.
virtual void SetVertexBuffers (std::uint32_t numBufferViews, const VertexBufferView *bufferViews)=0
 Sets the specified number of vertex buffers for subsequent drawing operations with optional strides and base offsets.
virtual void SetVertexBufferArray (BufferArray &bufferArray)=0
 Sets the specified array of vertex buffers for subsequent drawing operations.
virtual void SetIndexBuffer (Buffer &buffer)=0
 Sets the active index buffer for subsequent drawing operations.
virtual void SetIndexBuffer (Buffer &buffer, const Format format, std::uint64_t offset=0)=0
 Sets the active index buffer for subsequent drawing operations with a dynamic format and optional buffer offset.
virtual void SetResourceHeap (ResourceHeap &resourceHeap, std::uint32_t descriptorSet=0)=0
 Binds the specified resource heap to the respective pipeline.
virtual void SetResource (std::uint32_t descriptor, Resource &resource)=0
 Binds the specified resource as root parameter to the respective pipeline.
virtual void ResourceBarrier (std::uint32_t numBuffers, Buffer *const *buffers, std::uint32_t numTextures, Texture *const *textures)=0
 Inserts a resource memory barrier for the specified resources.
virtual void BeginRenderPass (RenderTarget &renderTarget, const RenderPass *renderPass=nullptr, std::uint32_t numClearValues=0, const ClearValue *clearValues=nullptr, std::uint32_t swapBufferIndex=LLGL_CURRENT_SWAP_INDEX)=0
 Begins with a new render pass.
virtual void EndRenderPass ()=0
 Ends the current render pass.
virtual void Clear (long flags, const ClearValue &clearValue={})=0
 Clears the specified group of attachments of the active render target.
virtual void ClearAttachments (std::uint32_t numAttachments, const AttachmentClear *attachments)=0
 Clears the specified attachments of the active render target.
virtual void SetPipelineState (PipelineState &pipelineState)=0
 Sets the active graphics or compute pipeline state.
virtual void SetBlendFactor (const float color[4])=0
 Sets the dynamic pipeline state for blending factors.
virtual void SetStencilReference (std::uint32_t reference, const StencilFace stencilFace=StencilFace::FrontAndBack)=0
 Sets the dynamic pipeline state for stencil reference values.
virtual void SetUniforms (std::uint32_t first, const void *data, std::uint16_t dataSize)=0
 Sets the value of a certain number of shader uniforms (aka. push constant/ shader constants) in the currently bound PSO.
virtual void BeginQuery (QueryHeap &queryHeap, std::uint32_t query=0)=0
 Begins a query of the specified query heap.
virtual void EndQuery (QueryHeap &queryHeap, std::uint32_t query=0)=0
 Ends the specified query.
virtual void BeginRenderCondition (QueryHeap &queryHeap, std::uint32_t query=0, const RenderConditionMode mode=RenderConditionMode::Wait)=0
 Begins conditional rendering with the specified query object.
virtual void EndRenderCondition ()=0
 Ends the current render condition.
virtual void BeginStreamOutput (std::uint32_t numBuffers, Buffer *const *buffers)=0
 Begins a stream-output section for subsequent draw calls.
virtual void EndStreamOutput ()=0
 Ends the current stream-output.
virtual void Draw (std::uint32_t numVertices, std::uint32_t firstVertex)=0
 Draws the specified amount of primitives from the currently set vertex buffer.
virtual void DrawIndexed (std::uint32_t numIndices, std::uint32_t firstIndex)=0
virtual void DrawIndexed (std::uint32_t numIndices, std::uint32_t firstIndex, std::int32_t vertexOffset)=0
 Draws the specified amount of primitives from the currently set vertex- and index buffers.
virtual void DrawInstanced (std::uint32_t numVertices, std::uint32_t firstVertex, std::uint32_t numInstances)=0
virtual void DrawInstanced (std::uint32_t numVertices, std::uint32_t firstVertex, std::uint32_t numInstances, std::uint32_t firstInstance)=0
 Draws the specified amount of instances of primitives from the currently set vertex buffer.
virtual void DrawIndexedInstanced (std::uint32_t numIndices, std::uint32_t numInstances, std::uint32_t firstIndex)=0
virtual void DrawIndexedInstanced (std::uint32_t numIndices, std::uint32_t numInstances, std::uint32_t firstIndex, std::int32_t vertexOffset)=0
virtual void DrawIndexedInstanced (std::uint32_t numIndices, std::uint32_t numInstances, std::uint32_t firstIndex, std::int32_t vertexOffset, std::uint32_t firstInstance)=0
 Draws the specified amount of instances of primitives from the currently set vertex- and index buffers.
virtual void DrawIndirect (Buffer &buffer, std::uint64_t offset)=0
 Draws an unknown amount of instances of primitives whose draw command arguments are taken from a buffer object.
virtual void DrawIndirect (Buffer &buffer, std::uint64_t offset, std::uint32_t numCommands, std::uint32_t stride)=0
 Draws an unknown amount of instances of primitives whose draw command arguments are taken from a buffer object.
virtual void DrawIndexedIndirect (Buffer &buffer, std::uint64_t offset)=0
 Draws an unknown amount of instances of primitives whose indexed draw command arguments are taken from a buffer object.
virtual void DrawIndexedIndirect (Buffer &buffer, std::uint64_t offset, std::uint32_t numCommands, std::uint32_t stride)=0
 Draws an unknown amount of instances of primitives whose indexed draw command arguments are taken from a buffer object.
virtual void DrawStreamOutput ()=0
 Performs an automatic draw command whose number of primitives is provided by a stream-output buffer that is bound as vertex buffer.
virtual void Dispatch (std::uint32_t numWorkGroupsX, std::uint32_t numWorkGroupsY, std::uint32_t numWorkGroupsZ)=0
 Dispatches a compute command.
virtual void DispatchIndirect (Buffer &buffer, std::uint64_t offset)=0
 Dispatches a compute command with an unknown amount of thread grounds.
virtual void PushDebugGroup (const char *name)=0
 Pushes the specified name onto a stack of group strings that is used for debug reports.
virtual void PopDebugGroup ()=0
virtual void DoNativeCommand (const void *nativeCommand, std::size_t nativeCommandSize)=0
 Performs a native command that is backend specific.
virtual bool GetNativeHandle (void *nativeHandle, std::size_t nativeHandleSize)=0
 Returns the native command buffer handle.
Public Member Functions inherited from LLGL::RenderSystemChild
virtual void SetDebugName (const char *name)
 Sets the name of this class instance for debugging purposes.
Public Member Functions inherited from LLGL::Interface
virtual bool IsInstanceOf (int id) const
 Returns true if this object is an instance of the specified interface.
Public Member Functions inherited from LLGL::NonCopyable
 NonCopyable (const NonCopyable &)=delete
NonCopyable & operator= (const NonCopyable &)=delete
virtual ~NonCopyable ()=default

Protected Member Functions

 CommandBufferTier1 ()=default
Protected Member Functions inherited from LLGL::CommandBuffer
 CommandBuffer ()=default
Protected Member Functions inherited from LLGL::NonCopyable
 NonCopyable ()=default

Detailed Description

Extended tier-1 command buffer interface.

Remarks
This command buffer extends the base interface with functions to record advanced rendering commands such as mesh pipeline tasks.
Note
Only supported with: Direct3D 12, Vulkan.
See also
RenderSystem::CreateCommandBuffer

Constructor & Destructor Documentation

◆ CommandBufferTier1()

LLGL::CommandBufferTier1::CommandBufferTier1 ( )
protecteddefault

Member Function Documentation

◆ DrawMesh()

virtual void LLGL::CommandBufferTier1::DrawMesh ( std::uint32_t numWorkGroupsX,
std::uint32_t numWorkGroupsY,
std::uint32_t numWorkGroupsZ )
pure virtual

Draws a mesh by dispatching shader work groups for mesh tasks.

Parameters
[in]numWorkGroupsXSpecifies the number of worker thread groups in the X-dimension.
[in]numWorkGroupsYSpecifies the number of worker thread groups in the Y-dimension.
[in]numWorkGroupsZSpecifies the number of worker thread groups in the Z-dimension.
See also
RenderingFeatures::hasMeshShaders

◆ DrawMeshIndirect() [1/2]

virtual void LLGL::CommandBufferTier1::DrawMeshIndirect ( Buffer & argumentsBuffer,
std::uint64_t argumentsOffset,
Buffer & countBuffer,
std::uint64_t countOffset,
std::uint32_t maxNumCommands,
std::uint32_t stride )
pure virtual

Draws an unknown amount of meshes whose draw command arguments are taken from a buffer object.

Parameters
[in]argumentsBufferSpecifies the buffer from which the draw command arguments are taken. This buffer must have been created with the BindFlags::IndirectBuffer binding flag.
[in]argumentsOffsetSpecifies an offset within the argument buffer from which the arguments are to be taken. This offset must be a multiple of 4.
[in]countBufferSpecifies the buffer from which the number of draw command arguments are taken. This buffer must have been created with the BindFlags::IndirectBuffer binding flag.
[in]countOffsetSpecifies the offset within the count buffer.
[in]maxNumCommandsSpecifies the maximum number of draw commands that are to be taken from the argument buffer. The lower bound is determined by the value taken from countBuffer. The exact number of commands processed is as \(\min \left\{ \mathit{countBuffer}_{\mathit{countOffset}}, \mathit{maxNumCommands} \right\}\).
[in]strideSpecifies the stride (in bytes) between consecutive sets of arguments, which is commonly greater than or equal to sizeof(DrawMeshIndirectArguments). This stride must be a multiple of 4.
See also
DrawMeshIndirectArguments
RenderingFeatures::hasMeshShaders

◆ DrawMeshIndirect() [2/2]

virtual void LLGL::CommandBufferTier1::DrawMeshIndirect ( Buffer & buffer,
std::uint64_t offset,
std::uint32_t numCommands,
std::uint32_t stride )
pure virtual

Draws an unknown amount of meshes whose draw command arguments are taken from a buffer object.

Parameters
[in]bufferSpecifies the buffer from which the draw command arguments are taken. This buffer must have been created with the BindFlags::IndirectBuffer binding flag.
[in]offsetSpecifies an offset within the argument buffer from which the arguments are to be taken. This offset must be a multiple of 4.
[in]numCommandsSpecifies the number of draw commands that are to be taken from the argument buffer.
[in]strideSpecifies the stride (in bytes) between consecutive sets of arguments, which is commonly greater than or equal to sizeof(DrawMeshIndirectArguments). This stride must be a multiple of 4.
See also
DrawMeshIndirectArguments
RenderingFeatures::hasMeshShaders

◆ SetShadingRate() [1/2]

virtual void LLGL::CommandBufferTier1::SetShadingRate ( ShadingRate shadingRate)
pure virtual

Sets the shading rate for subsequent drawing commands.

Parameters
[in]shadingRateSpecifies the new shading rate. To reset to the default shading rate of 1x1 pixels, use ShadingRate::Size1x1.
Remarks
This must only be used on a graphics or mesh pipeline that has variable rate shading enabled.
See also
RasterizerDescriptor::shadingRateEnabled
RenderingFeatures::hasVariableRateShading

◆ SetShadingRate() [2/2]

virtual void LLGL::CommandBufferTier1::SetShadingRate ( ShadingRate shadingRate,
ShadingRateOp combinerOpX,
ShadingRateOp combinerOpY )
pure virtual

Sets the shading rate for subsequent drawing commands.

Parameters
[in]shadingRateSpecifies the new shading rate. To reset to the default shading rate of 1x1 pixels, use ShadingRate::Size1x1.
[incombinerOpX Specifies how rendered primitives combine their X-axis shading rates.
[incombinerOpY Specifies how rendered primitives combine their Y-axis shading rates.
Remarks
This must only be used on a graphics or mesh pipeline that has variable rate shading enabled.
See also
RasterizerDescriptor::shadingRateEnabled
RenderingFeatures::hasVariableRateShading

The documentation for this class was generated from the following file: