24 #ifndef PXR_IMAGING_HD_BUFFER_ARRAY_REGISTRY_H
25 #define PXR_IMAGING_HD_BUFFER_ARRAY_REGISTRY_H
41 #include <tbb/concurrent_unordered_map.h>
43 #include <condition_variable>
92 const HdBufferArrayRegistry&
self);
97 HdBufferArrayRegistry &operator=(
const HdBufferArrayRegistry &) =
delete;
99 typedef std::list<HdBufferArraySharedPtr> _HdBufferArraySharedPtrList;
112 _HdBufferArraySharedPtrList bufferArrays;
114 std::condition_variable emptyCondition;
119 _Entry(
const _Entry &other) { TF_VERIFY(bufferArrays.empty()); }
126 class _EntryIsNotEmpty
129 _EntryIsNotEmpty(
const _Entry &entry) : _entry(entry) {}
132 return (!(_entry.bufferArrays.empty()));
136 const _Entry &_entry;
139 typedef tbb::concurrent_unordered_map< HdAggregationStrategy::AggregationId, _Entry> _BufferArrayIndex;
141 _BufferArrayIndex _entries;
150 void _InsertNewBufferArray(_Entry &entry,
161 #endif // PXR_IMAGING_HD_BUFFER_ARRAY_REGISTRY_H
~HdBufferArrayRegistry()=default
std::shared_ptr< class HdBufferArray > HdBufferArraySharedPtr
HD_API void ReallocateAll(HdAggregationStrategy *strategy)
Triggers reallocation on all buffers managed by the registry.
HD_API HdBufferArrayRegistry()
HD_API void GarbageCollect()
Frees up buffers that no longer contain any allocated ranges.
std::vector< struct HdBufferSpec > HdBufferSpecVector
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
HD_API size_t GetResourceAllocation(HdAggregationStrategy *strategy, VtDictionary &result) const
HF_MALLOC_TAG_NEW("new HdBufferArrayRegistry")
HD_API friend std::ostream & operator<<(std::ostream &out, const HdBufferArrayRegistry &self)
Debug dump.
#define PXR_NAMESPACE_CLOSE_SCOPE
std::shared_ptr< HdBufferArrayRange > HdBufferArrayRangeSharedPtr
HD_API HdBufferArrayRangeSharedPtr AllocateRange(HdAggregationStrategy *strategy, TfToken const &role, HdBufferSpecVector const &bufferSpecs, HdBufferArrayUsageHint usageHint)