HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HdStInterleavedMemoryManager::_StripedInterleavedBuffer Class Reference

striped buffer More...

#include <interleavedMemoryManager.h>

+ Inheritance diagram for HdStInterleavedMemoryManager::_StripedInterleavedBuffer:

Public Member Functions

HDST_API _StripedInterleavedBuffer (HdStInterleavedMemoryManager *mgr, HdStResourceRegistry *resourceRegistry, TfToken const &role, HdBufferSpecVector const &bufferSpecs, HdBufferArrayUsageHint usageHint, int bufferOffsetAlignment, int structAlignment, size_t maxSize, TfToken const &garbageCollectionPerfToken)
 Constructor. More...
 
virtual HDST_API ~_StripedInterleavedBuffer ()
 Destructor. It invalidates _rangeList. More...
 
virtual HDST_API bool GarbageCollect ()
 perform compaction if necessary, returns true if it becomes empty. More...
 
virtual HDST_API void DebugDump (std::ostream &out) const
 Debug output. More...
 
virtual HDST_API void Reallocate (std::vector< HdBufferArrayRangeSharedPtr > const &ranges, HdBufferArraySharedPtr const &curRangeOwner)
 
void SetNeedsReallocation ()
 Mark to perform reallocation on Reallocate() More...
 
void SetNeedsCompaction ()
 Mark to perform compaction on GarbageCollect() More...
 
size_t GetStride () const
 Returns the stride. More...
 
size_t GetElementStride () const
 
HDST_API
HdStBufferResourceSharedPtr 
GetResource () const
 
HDST_API
HdStBufferResourceSharedPtr 
GetResource (TfToken const &name)
 
HdStBufferResourceNamedList constGetResources () const
 Returns the list of all named GPU resources for this bufferArray. More...
 
HDST_API HdBufferSpecVector GetBufferSpecs () const
 Reconstructs the bufferspecs and returns it (for buffer splitting) More...
 
HdStInterleavedMemoryManagerGetManager () const
 
- Public Member Functions inherited from HdBufferArray
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 HD_API size_t GetMaxNumElements () const
 Returns the maximum number of elements capacity. 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

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. More...
 
- Protected Member Functions inherited from HdBufferArray
void _SetMaxNumRanges (size_t max)
 
HD_API void _SetRangeList (std::vector< HdBufferArrayRangeSharedPtr > const &ranges)
 Swap the rangelist with ranges. More...
 

Additional Inherited Members

- Protected Attributes inherited from HdBufferArray
bool _needsReallocation
 

Detailed Description

striped buffer

Definition at line 207 of file interleavedMemoryManager.h.

Constructor & Destructor Documentation

HDST_API HdStInterleavedMemoryManager::_StripedInterleavedBuffer::_StripedInterleavedBuffer ( HdStInterleavedMemoryManager mgr,
HdStResourceRegistry resourceRegistry,
TfToken const role,
HdBufferSpecVector const bufferSpecs,
HdBufferArrayUsageHint  usageHint,
int  bufferOffsetAlignment,
int  structAlignment,
size_t  maxSize,
TfToken const garbageCollectionPerfToken 
)

Constructor.

virtual HDST_API HdStInterleavedMemoryManager::_StripedInterleavedBuffer::~_StripedInterleavedBuffer ( )
virtual

Destructor. It invalidates _rangeList.

Member Function Documentation

HDST_API HdStBufferResourceSharedPtr HdStInterleavedMemoryManager::_StripedInterleavedBuffer::_AddResource ( TfToken const name,
HdTupleType  tupleType,
int  offset,
int  stride 
)
protected

Adds a new, named GPU resource and returns it.

HDST_API void HdStInterleavedMemoryManager::_StripedInterleavedBuffer::_DeallocateResources ( )
protected
virtual HDST_API void HdStInterleavedMemoryManager::_StripedInterleavedBuffer::DebugDump ( std::ostream &  out) const
virtual

Debug output.

Implements HdBufferArray.

virtual HDST_API bool HdStInterleavedMemoryManager::_StripedInterleavedBuffer::GarbageCollect ( )
virtual

perform compaction if necessary, returns true if it becomes empty.

Implements HdBufferArray.

HDST_API HdBufferSpecVector HdStInterleavedMemoryManager::_StripedInterleavedBuffer::GetBufferSpecs ( ) const

Reconstructs the bufferspecs and returns it (for buffer splitting)

size_t HdStInterleavedMemoryManager::_StripedInterleavedBuffer::GetElementStride ( ) const
inline

Definition at line 255 of file interleavedMemoryManager.h.

HdStInterleavedMemoryManager* HdStInterleavedMemoryManager::_StripedInterleavedBuffer::GetManager ( ) const
inline

Definition at line 279 of file interleavedMemoryManager.h.

HDST_API HdStBufferResourceSharedPtr HdStInterleavedMemoryManager::_StripedInterleavedBuffer::GetResource ( ) const

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

HDST_API HdStBufferResourceSharedPtr HdStInterleavedMemoryManager::_StripedInterleavedBuffer::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.

HdStBufferResourceNamedList const& HdStInterleavedMemoryManager::_StripedInterleavedBuffer::GetResources ( ) const
inline

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

Definition at line 272 of file interleavedMemoryManager.h.

size_t HdStInterleavedMemoryManager::_StripedInterleavedBuffer::GetStride ( ) const
inline

Returns the stride.

Definition at line 251 of file interleavedMemoryManager.h.

virtual HDST_API void HdStInterleavedMemoryManager::_StripedInterleavedBuffer::Reallocate ( std::vector< HdBufferArrayRangeSharedPtr > const ranges,
HdBufferArraySharedPtr const curRangeOwner 
)
virtual

Performs reallocation. GLX context has to be set when calling this function.

Implements HdBufferArray.

void HdStInterleavedMemoryManager::_StripedInterleavedBuffer::SetNeedsCompaction ( )
inline

Mark to perform compaction on GarbageCollect()

Definition at line 246 of file interleavedMemoryManager.h.

void HdStInterleavedMemoryManager::_StripedInterleavedBuffer::SetNeedsReallocation ( )
inline

Mark to perform reallocation on Reallocate()

Definition at line 241 of file interleavedMemoryManager.h.


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