Loading...
Searching...
No Matches
HgiIndirectCommandEncoder Class Referenceabstract

The indirect command encoder is used to record the drawing primitives for a batch and capture the resource bindings so that it can be executed efficently in a later stage of rendering. More...

#include <indirectCommandEncoder.h>

+ Inheritance diagram for HgiIndirectCommandEncoder:

Public Member Functions

virtual HGI_API HgiIndirectCommandsUniquePtr EncodeDraw (HgiComputeCmds *computeCmds, HgiGraphicsPipelineHandle const &pipeline, HgiResourceBindingsHandle const &resourceBindings, HgiVertexBufferBindingVector const &vertexBindings, HgiBufferHandle const &drawParameterBuffer, uint32_t drawBufferByteOffset, uint32_t drawCount, uint32_t stride)=0
 Encodes a batch of draw commands from the drawParameterBuffer.
 
virtual HGI_API HgiIndirectCommandsUniquePtr EncodeDrawIndexed (HgiComputeCmds *computeCmds, HgiGraphicsPipelineHandle const &pipeline, HgiResourceBindingsHandle const &resourceBindings, HgiVertexBufferBindingVector const &vertexBindings, HgiBufferHandle const &indexBuffer, HgiBufferHandle const &drawParameterBuffer, uint32_t drawBufferByteOffset, uint32_t drawCount, uint32_t stride, uint32_t patchBaseVertexByteOffset)=0
 Encodes a batch of indexed draw commands from the drawParameterBuffer.
 
virtual HGI_API void ExecuteDraw (HgiGraphicsCmds *gfxCmds, HgiIndirectCommands const *commands)=0
 Excutes an indirect command batch from the HgiIndirectCommands structure.
 
- Public Member Functions inherited from HgiCmds
HGI_API bool IsSubmitted () const
 Returns true if the HgiCmds object has been submitted to GPU.
 

Additional Inherited Members

- Protected Member Functions inherited from HgiCmds
virtual HGI_API bool _Submit (Hgi *hgi, HgiSubmitWaitType wait)
 
HGI_API void _SetSubmitted ()
 

Detailed Description

The indirect command encoder is used to record the drawing primitives for a batch and capture the resource bindings so that it can be executed efficently in a later stage of rendering.

The EncodeDraw and EncodeDrawIndexed functions store all the necessary state in the HgiIndirectCommands structure. This is sub-classed based on the platform implementation to maintain all the custom state. Execute draw takes the HgiIndirectCommands structure and replays it on the device. Currently this is only implemented on the Metal HGI device.

Definition at line 73 of file indirectCommandEncoder.h.

Member Function Documentation

◆ EncodeDraw()

virtual HGI_API HgiIndirectCommandsUniquePtr EncodeDraw ( HgiComputeCmds computeCmds,
HgiGraphicsPipelineHandle const &  pipeline,
HgiResourceBindingsHandle const &  resourceBindings,
HgiVertexBufferBindingVector const &  vertexBindings,
HgiBufferHandle const &  drawParameterBuffer,
uint32_t  drawBufferByteOffset,
uint32_t  drawCount,
uint32_t  stride 
)
pure virtual

Encodes a batch of draw commands from the drawParameterBuffer.

Returns a HgiIndirectCommands which holds the necessary buffers and state for replaying the batch.

◆ EncodeDrawIndexed()

virtual HGI_API HgiIndirectCommandsUniquePtr EncodeDrawIndexed ( HgiComputeCmds computeCmds,
HgiGraphicsPipelineHandle const &  pipeline,
HgiResourceBindingsHandle const &  resourceBindings,
HgiVertexBufferBindingVector const &  vertexBindings,
HgiBufferHandle const &  indexBuffer,
HgiBufferHandle const &  drawParameterBuffer,
uint32_t  drawBufferByteOffset,
uint32_t  drawCount,
uint32_t  stride,
uint32_t  patchBaseVertexByteOffset 
)
pure virtual

Encodes a batch of indexed draw commands from the drawParameterBuffer.

Returns a HgiIndirectCommands which holds the necessary buffers and state for replaying the batch.

◆ ExecuteDraw()

virtual HGI_API void ExecuteDraw ( HgiGraphicsCmds gfxCmds,
HgiIndirectCommands const *  commands 
)
pure virtual

Excutes an indirect command batch from the HgiIndirectCommands structure.


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