7 #ifndef PXR_IMAGING_HD_ST_BUFFER_ARRAY_REGISTRY_H
8 #define PXR_IMAGING_HD_ST_BUFFER_ARRAY_REGISTRY_H
23 #include <tbb/concurrent_unordered_map.h>
25 #include <condition_variable>
74 const HdStBufferArrayRegistry&
self);
79 HdStBufferArrayRegistry &operator=(
const HdStBufferArrayRegistry &)=
delete;
81 typedef std::list<HdBufferArraySharedPtr> _HdBufferArraySharedPtrList;
94 _HdBufferArraySharedPtrList bufferArrays;
96 std::condition_variable emptyCondition;
101 _Entry(
const _Entry &other) { TF_VERIFY(bufferArrays.empty()); }
108 class _EntryIsNotEmpty
111 _EntryIsNotEmpty(
const _Entry &entry) : _entry(entry) {}
114 return (!(_entry.bufferArrays.empty()));
118 const _Entry &_entry;
121 using _BufferArrayIndex = tbb::concurrent_unordered_map<
123 _BufferArrayIndex _entries;
132 void _InsertNewBufferArray(_Entry &entry,
143 #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.
uint32_t HdBufferArrayUsageHint
#define PXR_NAMESPACE_CLOSE_SCOPE
std::shared_ptr< HdBufferArrayRange > HdBufferArrayRangeSharedPtr
HF_MALLOC_TAG_NEW("new HdStBufferArrayRegistry")