HDK
|
#include <bufferArray.h>
Public Member Functions | |
HD_API | HdBufferArray (TfToken const &role, TfToken const garbageCollectionPerfToken, HdBufferArrayUsageHint usageHint) |
virtual HD_API | ~HdBufferArray () |
TfToken const & | GetRole () 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 |
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 87 of file bufferArray.h.
HD_API HdBufferArray::HdBufferArray | ( | TfToken const & | role, |
TfToken const | garbageCollectionPerfToken, | ||
HdBufferArrayUsageHint | usageHint | ||
) |
|
virtual |
|
inlineprotected |
Limits the number of ranges that can be allocated to this buffer to max.
Definition at line 170 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 HdBufferArray::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 137 of file bufferArray.h.
|
inline |
Returns the role of the GPU data in this bufferArray.
Definition at line 99 of file bufferArray.h.
|
inline |
Returns the usage hints for this buffer array.
Definition at line 159 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 103 of file bufferArray.h.
|
inline |
Returns true if this buffer array is marked as immutable.
Definition at line 154 of file bufferArray.h.
|
inline |
Returns true if Reallocate() needs to be called on this buffer array.
Definition at line 149 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.
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.
|
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 166 of file bufferArray.h.