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 (HdStRenderPassStateSharedPtr const &renderPassState, HdStResourceRegistrySharedPtr const &resourceRegistry)
 Prepare the command buffer for draw. More...
 
HDST_API void ExecuteDraw (HdStRenderPassStateSharedPtr const &renderPassState, HdStResourceRegistrySharedPtr const &resourceRegistry)
 Execute the command buffer. More...
 
HDST_API void FrustumCull (GfMatrix4d const &cullMatrix)
 Cull drawItemInstances based on passed in combined view and projection matrix. More...
 
HDST_API void SyncDrawItemVisibility (unsigned visChangeCount)
 Sync visibility state from RprimSharedState to DrawItemInstances. More...
 
HDST_API void SwapDrawItems (std::vector< HdStDrawItem const * > *items, unsigned currentBatchVersion)
 
HDST_API void RebuildDrawBatchesIfNeeded (unsigned currentBatchVersion)
 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 60 of file commandBuffer.h.

Constructor & Destructor Documentation

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

Member Function Documentation

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

Execute the command buffer.

HDST_API void HdStCommandBuffer::FrustumCull ( GfMatrix4d const cullMatrix)

Cull drawItemInstances based on passed in combined view and projection matrix.

size_t HdStCommandBuffer::GetCulledSize ( ) const
inline

Returns the number of culled draw items.

Definition at line 102 of file commandBuffer.h.

size_t HdStCommandBuffer::GetTotalSize ( ) const
inline

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

Definition at line 96 of file commandBuffer.h.

size_t HdStCommandBuffer::GetVisibleSize ( ) const
inline

Returns the number of draw items, excluding culled items.

Definition at line 99 of file commandBuffer.h.

HDST_API void HdStCommandBuffer::PrepareDraw ( HdStRenderPassStateSharedPtr const renderPassState,
HdStResourceRegistrySharedPtr const resourceRegistry 
)

Prepare the command buffer for draw.

HDST_API void HdStCommandBuffer::RebuildDrawBatchesIfNeeded ( unsigned  currentBatchVersion)

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

HDST_API void HdStCommandBuffer::SetEnableTinyPrimCulling ( bool  tinyPrimCulling)
HDST_API void HdStCommandBuffer::SwapDrawItems ( std::vector< HdStDrawItem const * > *  items,
unsigned  currentBatchVersion 
)

Destructively swaps the contents of items with the internal list of all draw items. Culling state is reset, with no items visible.

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: