7 #ifndef PXR_IMAGING_HD_ST_RENDER_BUFFER_POOL_H
8 #define PXR_IMAGING_HD_ST_RENDER_BUFFER_POOL_H
20 #include <unordered_map>
37 std::shared_ptr<HdStRenderBuffer>
buffer,
46 std::shared_ptr<HdStRenderBuffer> _buffer;
90 struct _PooledRenderBufferDesc
93 bool multiSampled : 1;
96 bool operator==(
const _PooledRenderBufferDesc &other)
const
98 return fmt == other.fmt &&
100 multiSampled == other.multiSampled &&
101 depth == other.depth;
107 return (((desc.multiSampled << 0) | (desc.depth << 2)
109 ^ (desc.dims[0] & 0xFFFF))
110 | ((size_t)(desc.dims[1] & 0xFFFF) << 32);
115 using _HdStRenderBufferVec =
116 std::vector<std::shared_ptr<HdStRenderBuffer>>;
118 class _AllocationTracker
125 std::deque<uint16_t> freeList;
128 struct _HdStRenderBufferPoolEntry
130 std::map<const SdfPath, _AllocationTracker> allocs;
134 std::unordered_map<_PooledRenderBufferDesc,
135 _HdStRenderBufferPoolEntry,
136 _PooledRenderBufferDesc::HashFunctor> _pooledRenderBuffers;
#define PXR_NAMESPACE_OPEN_SCOPE
size_t operator()(_PooledRenderBufferDesc const &desc) const
HdStRenderBuffer * GetBuffer() const
HDST_API HdStPooledRenderBufferUniquePtr Allocate(HdStResourceRegistry *registry, const SdfPath &graphPath, HdFormat fmt, GfVec2i dims, bool multiSampled, bool depth)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
std::unique_ptr< HdStPooledRenderBuffer > HdStPooledRenderBufferUniquePtr
HdStPooledRenderBuffer(std::shared_ptr< HdStRenderBuffer > buffer, HdStRenderBufferPool *pool, const SdfPath &graphPath, bool isDepth, uint16_t idx)
GLint GLint GLsizei GLsizei GLsizei depth
~HdStPooledRenderBuffer()
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
#define PXR_NAMESPACE_CLOSE_SCOPE
**Note that the tasks the is the thread number *for the pool
HDST_API void Free(HdFormat fmt, GfVec2i dims, bool multiSampled, bool depth, const SdfPath &graphPath, uint16_t idx)