Loading...
Searching...
No Matches
HdStCommandBuffer Class Reference

A buffer of commands (HdStDrawItem or HdComputeItem objects) to be executed. More...

#include <commandBuffer.h>

Public Member Functions

HDST_API void PrepareDraw (HgiGraphicsCmds *gfxCmds, HdStRenderPassStateSharedPtr const &renderPassState, HdRenderIndex *renderIndex)
 Prepare the command buffer for draw.
 
HDST_API void ExecuteDraw (HgiGraphicsCmds *gfxCmds, HdStRenderPassStateSharedPtr const &renderPassState, HdStResourceRegistrySharedPtr const &resourceRegistry)
 Execute the command buffer.
 
HDST_API void SyncDrawItemVisibility (unsigned visChangeCount)
 Sync visibility state from RprimSharedState to DrawItemInstances.
 
HDST_API void SetDrawItems (HdDrawItemConstPtrVectorSharedPtr const &drawItems, unsigned currentBatchVersion, Hgi const *hgi)
 Sets the draw items to use for batching.
 
HDST_API void RebuildDrawBatchesIfNeeded (unsigned currentBatchVersion, Hgi const *hgi)
 Rebuild all draw batches if any underlying buffer array is invalidated.
 
size_t GetTotalSize () const
 Returns the total number of draw items, including culled items.
 
size_t GetVisibleSize () const
 Returns the number of draw items, excluding culled items.
 
size_t GetCulledSize () const
 Returns the number of culled draw items.
 
HDST_API void SetEnableTinyPrimCulling (bool tinyPrimCulling)
 

Detailed Description

A buffer of commands (HdStDrawItem or HdComputeItem objects) to be executed.

The HdStCommandBuffer is responsible for accumulating draw items and sorting them for correctness (e.g. alpha transparency) and efficiency (e.g. the fewest number of GPU state changes).

Definition at line 64 of file commandBuffer.h.

Member Function Documentation

◆ ExecuteDraw()

HDST_API void ExecuteDraw ( HgiGraphicsCmds gfxCmds,
HdStRenderPassStateSharedPtr const &  renderPassState,
HdStResourceRegistrySharedPtr const &  resourceRegistry 
)

Execute the command buffer.

◆ GetCulledSize()

size_t GetCulledSize ( ) const
inline

Returns the number of culled draw items.

Definition at line 110 of file commandBuffer.h.

◆ GetTotalSize()

size_t GetTotalSize ( ) const
inline

Returns the total number of draw items, including culled items.

Definition at line 101 of file commandBuffer.h.

◆ GetVisibleSize()

size_t GetVisibleSize ( ) const
inline

Returns the number of draw items, excluding culled items.

Definition at line 107 of file commandBuffer.h.

◆ PrepareDraw()

HDST_API void PrepareDraw ( HgiGraphicsCmds gfxCmds,
HdStRenderPassStateSharedPtr const &  renderPassState,
HdRenderIndex renderIndex 
)

Prepare the command buffer for draw.

◆ RebuildDrawBatchesIfNeeded()

HDST_API void RebuildDrawBatchesIfNeeded ( unsigned  currentBatchVersion,
Hgi const *  hgi 
)

Rebuild all draw batches if any underlying buffer array is invalidated.

◆ SetDrawItems()

HDST_API void SetDrawItems ( HdDrawItemConstPtrVectorSharedPtr const &  drawItems,
unsigned  currentBatchVersion,
Hgi const *  hgi 
)

Sets the draw items to use for batching.

If the shared pointer or version is different, batches are rebuilt and the batch version is updated.

◆ SyncDrawItemVisibility()

HDST_API void SyncDrawItemVisibility ( unsigned  visChangeCount)

Sync visibility state from RprimSharedState to DrawItemInstances.


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