HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HdStCommandBuffer Class Reference

#include <commandBuffer.h>

Public Member Functions

HDST_API HdStCommandBuffer ()
 
HDST_API ~HdStCommandBuffer ()
 
HDST_API void PrepareDraw (HgiGraphicsCmds *gfxCmds, HdStRenderPassStateSharedPtr const &renderPassState, HdRenderIndex *renderIndex)
 Prepare the command buffer for draw. More...
 
HDST_API void ExecuteDraw (HgiGraphicsCmds *gfxCmds, HdStRenderPassStateSharedPtr const &renderPassState, HdStResourceRegistrySharedPtr const &resourceRegistry)
 Execute the command buffer. More...
 
HDST_API void SyncDrawItemVisibility (unsigned visChangeCount)
 Sync visibility state from RprimSharedState to DrawItemInstances. More...
 
HDST_API void SetDrawItems (HdDrawItemConstPtrVectorSharedPtr const &drawItems, unsigned currentBatchVersion, HgiCapabilities const *hgiCapabilities)
 
HDST_API void RebuildDrawBatchesIfNeeded (unsigned currentBatchVersion, HgiCapabilities const *hgiCapabilities)
 Rebuild all draw batches if any underlying buffer array is invalidated. More...
 
size_t GetTotalSize () const
 Returns the total number of draw items, including culled items. More...
 
size_t GetVisibleSize () const
 Returns the number of draw items, excluding culled items. More...
 
size_t GetCulledSize () const
 Returns the number of culled draw items. More...
 
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.

Constructor & Destructor Documentation

HDST_API HdStCommandBuffer::HdStCommandBuffer ( )
HDST_API HdStCommandBuffer::~HdStCommandBuffer ( )

Member Function Documentation

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

Execute the command buffer.

size_t HdStCommandBuffer::GetCulledSize ( ) const
inline

Returns the number of culled draw items.

Definition at line 110 of file commandBuffer.h.

size_t HdStCommandBuffer::GetTotalSize ( ) const
inline

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

Definition at line 101 of file commandBuffer.h.

size_t HdStCommandBuffer::GetVisibleSize ( ) const
inline

Returns the number of draw items, excluding culled items.

Definition at line 107 of file commandBuffer.h.

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

Prepare the command buffer for draw.

HDST_API void HdStCommandBuffer::RebuildDrawBatchesIfNeeded ( unsigned  currentBatchVersion,
HgiCapabilities const hgiCapabilities 
)

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

HDST_API void HdStCommandBuffer::SetDrawItems ( HdDrawItemConstPtrVectorSharedPtr const drawItems,
unsigned  currentBatchVersion,
HgiCapabilities const hgiCapabilities 
)

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.

HDST_API void HdStCommandBuffer::SetEnableTinyPrimCulling ( bool  tinyPrimCulling)
HDST_API void HdStCommandBuffer::SyncDrawItemVisibility ( unsigned  visChangeCount)

Sync visibility state from RprimSharedState to DrawItemInstances.


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