![]() |
Similar to a VAO, this object is a bundle of coherent buffers. More...
Public Member Functions | |
HD_API | HdBufferArray (TfToken const &role, TfToken const garbageCollectionPerfToken, HdBufferArrayUsageHint usageHint) |
TfToken const & | GetRole () const |
Returns the role of the GPU data in this bufferArray. More... | |
size_t | GetVersion () const |
Returns the version of this buffer array. More... | |
HD_API void | IncrementVersion () |
Increments the version of this buffer array. More... | |
HD_API bool | TryAssignRange (HdBufferArrayRangeSharedPtr &range) |
Attempts to assign a range to this buffer array. More... | |
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 |
Performs reallocation. More... | |
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 () |
Remove any ranges from the range list that have been deallocated Returns number of ranges after clean-up. More... | |
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) |
Limits the number of ranges that can be allocated to this buffer to max. More... | |
HD_API void | _SetRangeList (std::vector< HdBufferArrayRangeSharedPtr > const &ranges) |
Swap the rangelist with ranges . More... | |
Protected Attributes | |
bool | _needsReallocation |
Dirty bit to set when the ranges attached to the buffer changes. More... | |
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.
|
inlineprotected |
Limits the number of ranges that can be allocated to this buffer to max.
Definition at line 171 of file bufferArray.h.
|
protected |
Swap the rangelist with ranges
.
|
pure virtual |
Debug output.
Implemented in HdStVBOMemoryManager::_StripedBufferArray, HdStVBOSimpleMemoryManager::_SimpleBufferArray, HdStInterleavedMemoryManager::_StripedInterleavedBuffer, and HdStDispatchBuffer.
|
pure virtual |
Performs compaction if necessary and returns true if it becomes empty.
Implemented in HdStVBOMemoryManager::_StripedBufferArray, HdStVBOSimpleMemoryManager::_SimpleBufferArray, HdStInterleavedMemoryManager::_StripedInterleavedBuffer, and HdStDispatchBuffer.
|
virtual |
Returns the maximum number of elements capacity.
Reimplemented in HdStVBOMemoryManager::_StripedBufferArray, and HdStVBOSimpleMemoryManager::_SimpleBufferArray.
HD_API HdBufferArrayRangePtr GetRange | ( | size_t | idx | ) | const |
Get the attached range at the specified index.
|
inline |
How many ranges are attached to the buffer array.
Definition at line 138 of file bufferArray.h.
|
inline |
Returns the role of the GPU data in this bufferArray.
Definition at line 100 of file bufferArray.h.
|
inline |
Returns the usage hints for this buffer array.
Definition at line 160 of file bufferArray.h.
|
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 IncrementVersion | ( | ) |
Increments the version of this buffer array.
|
inline |
Returns true if this buffer array is marked as immutable.
Definition at line 155 of file bufferArray.h.
|
inline |
Returns true if Reallocate() needs to be called on this buffer array.
Definition at line 150 of file bufferArray.h.
|
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 RemoveUnusedRanges | ( | ) |
Remove any ranges from the range list that have been deallocated Returns number of ranges after clean-up.
HD_API bool 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.
|
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.