24 #ifndef PXR_IMAGING_HD_ST_BUFFER_ARRAY_REGISTRY_H
25 #define PXR_IMAGING_HD_ST_BUFFER_ARRAY_REGISTRY_H
40 #include <tbb/concurrent_unordered_map.h>
42 #include <condition_variable>
91 const HdStBufferArrayRegistry&
self);
96 HdStBufferArrayRegistry &operator=(
const HdStBufferArrayRegistry &)=
delete;
98 typedef std::list<HdBufferArraySharedPtr> _HdBufferArraySharedPtrList;
111 _HdBufferArraySharedPtrList bufferArrays;
113 std::condition_variable emptyCondition;
118 _Entry(
const _Entry &other) { TF_VERIFY(bufferArrays.empty()); }
125 class _EntryIsNotEmpty
128 _EntryIsNotEmpty(
const _Entry &entry) : _entry(entry) {}
131 return (!(_entry.bufferArrays.empty()));
135 const _Entry &_entry;
138 using _BufferArrayIndex = tbb::concurrent_unordered_map<
140 _BufferArrayIndex _entries;
149 void _InsertNewBufferArray(_Entry &entry,
160 #endif // PXR_IMAGING_HD_ST_BUFFER_ARRAY_REGISTRY_H
~HdStBufferArrayRegistry()=default
std::shared_ptr< class HdBufferArray > HdBufferArraySharedPtr
HDST_API size_t GetResourceAllocation(HdStAggregationStrategy *strategy, VtDictionary &result) const
**But if you need a result
HDST_API HdBufferArrayRangeSharedPtr AllocateRange(HdStAggregationStrategy *strategy, TfToken const &role, HdBufferSpecVector const &bufferSpecs, HdBufferArrayUsageHint usageHint)
size_t AggregationId
Aggregation ID.
HDST_API void ReallocateAll(HdStAggregationStrategy *strategy)
Triggers reallocation on all buffers managed by the registry.
HDST_API HdStBufferArrayRegistry()
std::vector< struct HdBufferSpec > HdBufferSpecVector
HDST_API void GarbageCollect()
Frees up buffers that no longer contain any allocated ranges.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
HDST_API friend std::ostream & operator<<(std::ostream &out, const HdStBufferArrayRegistry &self)
Debug dump.
#define PXR_NAMESPACE_CLOSE_SCOPE
std::shared_ptr< HdBufferArrayRange > HdBufferArrayRangeSharedPtr
HF_MALLOC_TAG_NEW("new HdStBufferArrayRegistry")