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

#include <bufferArray.h>

+ Inheritance diagram for HdBufferArray:

Public Member Functions

HD_API HdBufferArray (TfToken const &role, TfToken const garbageCollectionPerfToken, HdBufferArrayUsageHint usageHint)
 
virtual HD_API ~HdBufferArray ()
 
TfToken constGetRole () const
 Returns the role of the GPU data in this bufferArray. More...
 
size_t GetVersion () const
 
HD_API void IncrementVersion ()
 Increments the version of this buffer array. More...
 
HD_API bool TryAssignRange (HdBufferArrayRangeSharedPtr &range)
 
virtual bool GarbageCollect ()=0
 Performs compaction if necessary and returns true if it becomes empty. More...
 
virtual void Reallocate (std::vector< HdBufferArrayRangeSharedPtr > const &ranges, HdBufferArraySharedPtr const &curRangeOwner)=0
 
virtual HD_API size_t GetMaxNumElements () const
 Returns the maximum number of elements capacity. More...
 
virtual void DebugDump (std::ostream &out) const =0
 Debug output. More...
 
size_t GetRangeCount () const
 How many ranges are attached to the buffer array. More...
 
HD_API HdBufferArrayRangePtr GetRange (size_t idx) const
 Get the attached range at the specified index. More...
 
HD_API void RemoveUnusedRanges ()
 
bool NeedsReallocation () const
 Returns true if Reallocate() needs to be called on this buffer array. More...
 
bool IsImmutable () const
 Returns true if this buffer array is marked as immutable. More...
 
HdBufferArrayUsageHint GetUsageHint () const
 Returns the usage hints for this buffer array. More...
 

Protected Member Functions

void _SetMaxNumRanges (size_t max)
 
HD_API void _SetRangeList (std::vector< HdBufferArrayRangeSharedPtr > const &ranges)
 Swap the rangelist with ranges. More...
 

Protected Attributes

bool _needsReallocation
 

Detailed Description

Similar to a VAO, this object is a bundle of coherent buffers. This object can be shared across multiple HdRprims, in the context of buffer aggregation.

Definition at line 88 of file bufferArray.h.

Constructor & Destructor Documentation

HD_API HdBufferArray::HdBufferArray ( TfToken const role,
TfToken const  garbageCollectionPerfToken,
HdBufferArrayUsageHint  usageHint 
)
virtual HD_API HdBufferArray::~HdBufferArray ( )
virtual

Member Function Documentation

void HdBufferArray::_SetMaxNumRanges ( size_t  max)
inlineprotected

Limits the number of ranges that can be allocated to this buffer to max.

Definition at line 171 of file bufferArray.h.

HD_API void HdBufferArray::_SetRangeList ( std::vector< HdBufferArrayRangeSharedPtr > const ranges)
protected

Swap the rangelist with ranges.

virtual void HdBufferArray::DebugDump ( std::ostream &  out) const
pure virtual
virtual bool HdBufferArray::GarbageCollect ( )
pure virtual
virtual HD_API size_t HdBufferArray::GetMaxNumElements ( ) const
virtual

Returns the maximum number of elements capacity.

Reimplemented in HdStVBOMemoryManager::_StripedBufferArray, and HdStVBOSimpleMemoryManager::_SimpleBufferArray.

HD_API HdBufferArrayRangePtr HdBufferArray::GetRange ( size_t  idx) const

Get the attached range at the specified index.

size_t HdBufferArray::GetRangeCount ( ) const
inline

How many ranges are attached to the buffer array.

Definition at line 138 of file bufferArray.h.

TfToken const& HdBufferArray::GetRole ( ) const
inline

Returns the role of the GPU data in this bufferArray.

Definition at line 100 of file bufferArray.h.

HdBufferArrayUsageHint HdBufferArray::GetUsageHint ( ) const
inline

Returns the usage hints for this buffer array.

Definition at line 160 of file bufferArray.h.

size_t HdBufferArray::GetVersion ( ) const
inline

Returns the version of this buffer array. Used to determine when to rebuild outdated indirect dispatch buffers

Definition at line 104 of file bufferArray.h.

HD_API void HdBufferArray::IncrementVersion ( )

Increments the version of this buffer array.

bool HdBufferArray::IsImmutable ( ) const
inline

Returns true if this buffer array is marked as immutable.

Definition at line 155 of file bufferArray.h.

bool HdBufferArray::NeedsReallocation ( ) const
inline

Returns true if Reallocate() needs to be called on this buffer array.

Definition at line 150 of file bufferArray.h.

virtual void HdBufferArray::Reallocate ( std::vector< HdBufferArrayRangeSharedPtr > const ranges,
HdBufferArraySharedPtr const curRangeOwner 
)
pure virtual

Performs reallocation. After reallocation, the buffer will contain the specified ranges. If these ranges are currently held by a different buffer array instance, then their data will be copied from the specified curRangeOwner.

Implemented in HdStVBOMemoryManager::_StripedBufferArray, HdStVBOSimpleMemoryManager::_SimpleBufferArray, HdStInterleavedMemoryManager::_StripedInterleavedBuffer, and HdStDispatchBuffer.

HD_API void HdBufferArray::RemoveUnusedRanges ( )

Remove any ranges from the range list that have been deallocated Returns number of ranges after clean-up

HD_API bool HdBufferArray::TryAssignRange ( HdBufferArrayRangeSharedPtr range)

Attempts to assign a range to this buffer array. Multiple threads could be trying to assign to this buffer at the same time. Returns true is the range is assigned to this buffer otherwise returns false if the buffer doesn't have space to assign the range.

Member Data Documentation

bool HdBufferArray::_needsReallocation
protected

Dirty bit to set when the ranges attached to the buffer changes. If set Reallocate() should be called to clean it.

Definition at line 167 of file bufferArray.h.


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