|
Interface class for representing range (subset) locator of HdBufferArray. More...
#include <bufferArrayRange.h>
Public Member Functions | |
HdStBufferArrayRange (HdStResourceRegistry *resourceRegistry) | |
virtual HDST_API | ~HdStBufferArrayRange () |
Destructor (do nothing). | |
virtual HdStBufferResourceSharedPtr | GetResource () const =0 |
Returns the GPU resource. | |
virtual HdStBufferResourceSharedPtr | GetResource (TfToken const &name)=0 |
Returns the named GPU resource. | |
virtual HdStBufferResourceNamedList const & | GetResources () const =0 |
Returns the list of all named GPU resources for this bufferArrayRange. | |
virtual HDST_API void | GetBufferSpecs (HdBufferSpecVector *bufferSpecs) const override |
Sets the bufferSpecs for all resources. | |
virtual int | GetElementStride () const |
Public Member Functions inherited from HdBufferArrayRange | |
virtual HD_API | ~HdBufferArrayRange () |
Destructor (do nothing). | |
virtual bool | IsValid () const =0 |
Returns true if this range is valid. | |
virtual bool | IsAssigned () const =0 |
Returns true is the range has been assigned to a buffer. | |
virtual bool | IsImmutable () const =0 |
Returns true if this range is marked as immutable. | |
virtual bool | RequiresStaging () const =0 |
Returns true if this needs a staging buffer for CPU to GPU copies. | |
virtual bool | Resize (int numElements)=0 |
Resize memory area for this range. | |
virtual void | CopyData (HdBufferSourceSharedPtr const &bufferSource)=0 |
Copy source data into buffer. | |
virtual VtValue | ReadData (TfToken const &name) const =0 |
Read back the buffer content. | |
virtual int | GetElementOffset () const =0 |
Returns the offset at which this range begins in the underlying buffer array in terms of elements. | |
virtual int | GetByteOffset (TfToken const &resourceName) const =0 |
Returns the byte offset at which this range begins in the underlying buffer array for the given resource. | |
virtual size_t | GetNumElements () const =0 |
Returns the number of elements. | |
virtual size_t | GetVersion () const =0 |
Returns the version of the buffer array. | |
virtual void | IncrementVersion ()=0 |
Increment the version of the buffer array. | |
virtual size_t | GetMaxNumElements () const =0 |
Returns the max number of elements. | |
virtual HdBufferArrayUsageHint | GetUsageHint () const =0 |
Gets the usage hint on the underlying buffer array. | |
virtual void | SetBufferArray (HdBufferArray *bufferArray)=0 |
Sets the buffer array associated with this buffer;. | |
virtual void | DebugDump (std::ostream &out) const =0 |
Debug output. | |
bool | IsAggregatedWith (HdBufferArrayRangeSharedPtr const &other) const |
Returns true if the underlying buffer array is aggregated to other's. | |
virtual void | GetBufferSpecs (HdBufferSpecVector *bufferSpecs) const =0 |
Gets the bufferSpecs for all resources. | |
Protected Member Functions | |
HdStResourceRegistry * | GetResourceRegistry () |
HdStResourceRegistry * | GetResourceRegistry () const |
Protected Member Functions inherited from HdBufferArrayRange | |
virtual const void * | _GetAggregation () const =0 |
Returns the aggregation container to be used in IsAggregatedWith() | |
HdBufferArrayRange (const HdBufferArrayRange &)=delete | |
HdBufferArrayRange & | operator= (const HdBufferArrayRange &)=delete |
Interface class for representing range (subset) locator of HdBufferArray.
Each memory management strategy defines a specialized range class which is inherited of this interface so that client (drawItem) can be agnostic about the implementation detail of aggregation.
Definition at line 59 of file bufferArrayRange.h.
|
virtual |
Destructor (do nothing).
The specialized range class may want to do something for garbage collection in its destructor. However, be careful not do any substantial work here (obviously including any kind of GL calls), since the destructor gets called frequently on various contexts.
|
overridevirtual |
Sets the bufferSpecs for all resources.
Implements HdBufferArrayRange.
|
inlinevirtual |
Definition at line 86 of file bufferArrayRange.h.
|
pure virtual |
Returns the GPU resource.
If the buffer array contains more than one resource, this method raises a coding error.
Implemented in HdStInterleavedMemoryManager::_StripedInterleavedBufferRange, HdStVBOMemoryManager::_StripedBufferArrayRange, and HdStVBOSimpleMemoryManager::_SimpleBufferArrayRange.
|
pure virtual |
Returns the named GPU resource.
Implemented in HdStInterleavedMemoryManager::_StripedInterleavedBufferRange, HdStVBOMemoryManager::_StripedBufferArrayRange, and HdStVBOSimpleMemoryManager::_SimpleBufferArrayRange.
|
pure virtual |
Returns the list of all named GPU resources for this bufferArrayRange.
Implemented in HdStInterleavedMemoryManager::_StripedInterleavedBufferRange, HdStVBOMemoryManager::_StripedBufferArrayRange, and HdStVBOSimpleMemoryManager::_SimpleBufferArrayRange.