Loading...
Searching...
No Matches
HdStVBOMemoryManager::_StripedBufferArray Class Reference

striped buffer array More...

#include <vboMemoryManager.h>

+ Inheritance diagram for HdStVBOMemoryManager::_StripedBufferArray:

Public Member Functions

HDST_API _StripedBufferArray (HdStResourceRegistry *resourceRegistry, TfToken const &role, HdBufferSpecVector const &bufferSpecs, HdBufferArrayUsageHint usageHint)
 Constructor.
 
HDST_API ~_StripedBufferArray () override
 Destructor. It invalidates _rangeList.
 
HDST_API bool GarbageCollect () override
 perform compaction if necessary.
 
HDST_API void DebugDump (std::ostream &out) const override
 Debug output.
 
HDST_API void Reallocate (std::vector< HdBufferArrayRangeSharedPtr > const &ranges, HdBufferArraySharedPtr const &curRangeOwner) override
 Performs reallocation.
 
HDST_API size_t GetMaxNumElements () const override
 Returns the maximum number of elements capacity.
 
void SetNeedsReallocation ()
 Mark to perform reallocation on Reallocate()
 
void SetNeedsCompaction ()
 Mark to perform compaction on GarbageCollect()
 
HDST_API HdStBufferResourceSharedPtr GetResource () const
 Returns the GPU resource.
 
HDST_API HdStBufferResourceSharedPtr GetResource (TfToken const &name)
 Returns the named GPU resource.
 
HdStBufferResourceNamedList const & GetResources () const
 Returns the list of all named GPU resources for this bufferArray.
 
HDST_API HdBufferSpecVector GetBufferSpecs () const
 Reconstructs the bufferspecs and returns it (for buffer splitting)
 
- Public Member Functions inherited from HdBufferArray
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.
 
size_t GetVersion () const
 Returns the version of this buffer array.
 
HD_API void IncrementVersion ()
 Increments the version of this buffer array.
 
HD_API bool TryAssignRange (HdBufferArrayRangeSharedPtr &range)
 Attempts to assign a range to this buffer array.
 
virtual bool GarbageCollect ()=0
 Performs compaction if necessary and returns true if it becomes empty.
 
virtual void Reallocate (std::vector< HdBufferArrayRangeSharedPtr > const &ranges, HdBufferArraySharedPtr const &curRangeOwner)=0
 Performs reallocation.
 
virtual HD_API size_t GetMaxNumElements () const
 Returns the maximum number of elements capacity.
 
virtual void DebugDump (std::ostream &out) const =0
 Debug output.
 
size_t GetRangeCount () const
 How many ranges are attached to the buffer array.
 
HD_API HdBufferArrayRangePtr GetRange (size_t idx) const
 Get the attached range at the specified index.
 
HD_API void RemoveUnusedRanges ()
 Remove any ranges from the range list that have been deallocated Returns number of ranges after clean-up.
 
bool NeedsReallocation () const
 Returns true if Reallocate() needs to be called on this buffer array.
 
bool IsImmutable () const
 Returns true if this buffer array is marked as immutable.
 
HdBufferArrayUsageHint GetUsageHint () const
 Returns the usage hints for this buffer array.
 

Protected Member Functions

HDST_API void _DeallocateResources ()
 
HDST_API HdStBufferResourceSharedPtr _AddResource (TfToken const &name, HdTupleType tupleType, int offset, int stride)
 Adds a new, named GPU resource and returns it.
 
- Protected Member Functions inherited from HdBufferArray
void _SetMaxNumRanges (size_t max)
 Limits the number of ranges that can be allocated to this buffer to max.
 
HD_API void _SetRangeList (std::vector< HdBufferArrayRangeSharedPtr > const &ranges)
 Swap the rangelist with ranges.
 

Additional Inherited Members

- Protected Attributes inherited from HdBufferArray
bool _needsReallocation
 Dirty bit to set when the ranges attached to the buffer changes.
 

Detailed Description

striped buffer array

Definition at line 241 of file vboMemoryManager.h.

Constructor & Destructor Documentation

◆ _StripedBufferArray()

HDST_API _StripedBufferArray ( HdStResourceRegistry resourceRegistry,
TfToken const &  role,
HdBufferSpecVector const &  bufferSpecs,
HdBufferArrayUsageHint  usageHint 
)

Constructor.

◆ ~_StripedBufferArray()

HDST_API ~_StripedBufferArray ( )
override

Destructor. It invalidates _rangeList.

Member Function Documentation

◆ _AddResource()

HDST_API HdStBufferResourceSharedPtr _AddResource ( TfToken const &  name,
HdTupleType  tupleType,
int  offset,
int  stride 
)
protected

Adds a new, named GPU resource and returns it.

◆ DebugDump()

HDST_API void DebugDump ( std::ostream &  out) const
overridevirtual

Debug output.

Implements HdBufferArray.

◆ GarbageCollect()

HDST_API bool GarbageCollect ( )
overridevirtual

perform compaction if necessary.

If it becomes empty, release all resources and returns true

Implements HdBufferArray.

◆ GetBufferSpecs()

HDST_API HdBufferSpecVector GetBufferSpecs ( ) const

Reconstructs the bufferspecs and returns it (for buffer splitting)

◆ GetMaxNumElements()

HDST_API size_t GetMaxNumElements ( ) const
overridevirtual

Returns the maximum number of elements capacity.

Reimplemented from HdBufferArray.

◆ GetResource() [1/2]

HDST_API HdStBufferResourceSharedPtr GetResource ( ) const

Returns the GPU resource.

If the buffer array contains more than one resource, this method raises a coding error.

◆ GetResource() [2/2]

HDST_API HdStBufferResourceSharedPtr GetResource ( TfToken const &  name)

Returns the named GPU resource.

This method returns the first found resource. In HD_SAFE_MODE it checks all underlying GL buffers in _resourceMap and raises a coding error if there are more than one GL buffers exist.

◆ GetResources()

HdStBufferResourceNamedList const & GetResources ( ) const
inline

Returns the list of all named GPU resources for this bufferArray.

Definition at line 298 of file vboMemoryManager.h.

◆ Reallocate()

HDST_API void Reallocate ( std::vector< HdBufferArrayRangeSharedPtr > const &  ranges,
HdBufferArraySharedPtr const &  curRangeOwner 
)
overridevirtual

Performs reallocation.

GLX context has to be set when calling this function.

Implements HdBufferArray.

◆ SetNeedsCompaction()

void SetNeedsCompaction ( )
inline

Mark to perform compaction on GarbageCollect()

Definition at line 281 of file vboMemoryManager.h.

◆ SetNeedsReallocation()

void SetNeedsReallocation ( )
inline

Mark to perform reallocation on Reallocate()

Definition at line 276 of file vboMemoryManager.h.


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