HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HgiIndirectCommandEncoder Class Referenceabstract

#include <indirectCommandEncoder.h>

+ Inheritance diagram for HgiIndirectCommandEncoder:

Public Member Functions

HGI_API ~HgiIndirectCommandEncoder () override
 
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
 
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
 
virtual HGI_API void ExecuteDraw (HgiGraphicsCmds *gfxCmds, HgiIndirectCommands const *commands)=0
 
- Public Member Functions inherited from HgiCmds
virtual HGI_API ~HgiCmds ()
 
HGI_API bool IsSubmitted () const
 Returns true if the HgiCmds object has been submitted to GPU. More...
 

Protected Member Functions

HGI_API HgiIndirectCommandEncoder ()
 
- Protected Member Functions inherited from HgiCmds
HGI_API 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.

Constructor & Destructor Documentation

HGI_API HgiIndirectCommandEncoder::~HgiIndirectCommandEncoder ( )
override
HGI_API HgiIndirectCommandEncoder::HgiIndirectCommandEncoder ( )
protected

Member Function Documentation

virtual HGI_API HgiIndirectCommandsUniquePtr HgiIndirectCommandEncoder::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.

virtual HGI_API HgiIndirectCommandsUniquePtr HgiIndirectCommandEncoder::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.

virtual HGI_API void HgiIndirectCommandEncoder::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: