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

#include <vboSimpleMemoryManager.h>

+ Inheritance diagram for HdStVBOSimpleMemoryManager::_SimpleBufferArray:

Public Member Functions

HDST_API _SimpleBufferArray (Hgi *hgi, TfToken const &role, HdBufferSpecVector const &bufferSpecs, HdBufferArrayUsageHint usageHint)
 Constructor. More...
 
virtual HDST_API ~_SimpleBufferArray ()
 Destructor. It invalidates _range. 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...
 
HDST_API bool Resize (int numElements)
 Set to resize buffers. Actual reallocation happens on Reallocate() More...
 
virtual HDST_API void Reallocate (std::vector< HdBufferArrayRangeSharedPtr > const &ranges, HdBufferArraySharedPtr const &curRangeOwner)
 
virtual HDST_API size_t GetMaxNumElements () const
 Returns the maximum number of elements capacity. More...
 
int GetCapacity () const
 Returns current capacity. It could be different from numElements. More...
 
HDST_API
HdStBufferResourceGLSharedPtr 
GetResource () const
 
HDST_API
HdStBufferResourceGLSharedPtr 
GetResource (TfToken const &name)
 
HdStBufferResourceGLNamedList
const
GetResources () 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...
 
- 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)
 
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
HdStBufferResourceGLSharedPtr 
_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

Simple buffer array (non-aggregated).

Definition at line 214 of file vboSimpleMemoryManager.h.

Constructor & Destructor Documentation

HDST_API HdStVBOSimpleMemoryManager::_SimpleBufferArray::_SimpleBufferArray ( Hgi hgi,
TfToken const role,
HdBufferSpecVector const bufferSpecs,
HdBufferArrayUsageHint  usageHint 
)

Constructor.

virtual HDST_API HdStVBOSimpleMemoryManager::_SimpleBufferArray::~_SimpleBufferArray ( )
virtual

Destructor. It invalidates _range.

Member Function Documentation

HDST_API HdStBufferResourceGLSharedPtr HdStVBOSimpleMemoryManager::_SimpleBufferArray::_AddResource ( TfToken const name,
HdTupleType  tupleType,
int  offset,
int  stride 
)
protected

Adds a new, named GPU resource and returns it.

HDST_API void HdStVBOSimpleMemoryManager::_SimpleBufferArray::_DeallocateResources ( )
protected
virtual HDST_API void HdStVBOSimpleMemoryManager::_SimpleBufferArray::DebugDump ( std::ostream &  out) const
virtual

Debug output.

Implements HdBufferArray.

virtual HDST_API bool HdStVBOSimpleMemoryManager::_SimpleBufferArray::GarbageCollect ( )
virtual

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

Implements HdBufferArray.

HDST_API HdBufferSpecVector HdStVBOSimpleMemoryManager::_SimpleBufferArray::GetBufferSpecs ( ) const

Reconstructs the bufferspecs and returns it (for buffer splitting)

int HdStVBOSimpleMemoryManager::_SimpleBufferArray::GetCapacity ( ) const
inline

Returns current capacity. It could be different from numElements.

Definition at line 252 of file vboSimpleMemoryManager.h.

virtual HDST_API size_t HdStVBOSimpleMemoryManager::_SimpleBufferArray::GetMaxNumElements ( ) const
virtual

Returns the maximum number of elements capacity.

Reimplemented from HdBufferArray.

HDST_API HdStBufferResourceGLSharedPtr HdStVBOSimpleMemoryManager::_SimpleBufferArray::GetResource ( ) const

TODO: We need to distinguish between the primvar types here, we should tag each HdBufferSource and HdBufferResource with Constant, Uniform, Varying, Vertex, or FaceVarying and provide accessors for the specific buffer types. Returns the GPU resource. If the buffer array contains more than one resource, this method raises a coding error.

HDST_API HdStBufferResourceGLSharedPtr HdStVBOSimpleMemoryManager::_SimpleBufferArray::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.

HdStBufferResourceGLNamedList const& HdStVBOSimpleMemoryManager::_SimpleBufferArray::GetResources ( ) const
inline

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

Definition at line 274 of file vboSimpleMemoryManager.h.

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

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

Implements HdBufferArray.

HDST_API bool HdStVBOSimpleMemoryManager::_SimpleBufferArray::Resize ( int  numElements)

Set to resize buffers. Actual reallocation happens on Reallocate()


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