24 #ifndef PXR_IMAGING_HD_ST_TEXTURE_HANDLE_REGISTRY_H
25 #define PXR_IMAGING_HD_ST_TEXTURE_HANDLE_REGISTRY_H
34 #include <tbb/concurrent_vector.h>
47 std::weak_ptr<class HdStTextureHandle>;
49 std::shared_ptr<class HdStTextureHandle>;
51 std::weak_ptr<class HdStTextureObject>;
53 std::shared_ptr<class HdStTextureObject>;
55 std::shared_ptr<class HdStSamplerObject>;
57 std::weak_ptr<class HdStShaderCode>;
59 std::shared_ptr<class HdStShaderCode>;
121 return _textureObjectRegistry.get();
127 return _samplerObjectRegistry.get();
137 std::set<HdStShaderCodeSharedPtr>
Commit();
154 void _ComputeMemoryRequests(
const std::set<HdStTextureObjectSharedPtr> &);
155 void _ComputeAllMemoryRequests();
157 bool _GarbageCollectHandlesAndComputeTargetMemory();
158 void _GarbageCollectAndComputeTargetMemory();
159 std::set<HdStShaderCodeSharedPtr> _Commit();
161 class _TextureToHandlesMap;
167 std::map<HdTextureType, size_t> _textureTypeToMemoryRequest;
169 bool _textureTypeToMemoryRequestChanged;
174 tbb::concurrent_vector<HdStTextureHandlePtr> _dirtyHandles;
178 tbb::concurrent_vector<HdStTextureObjectPtr> _dirtyTextures;
183 tbb::concurrent_vector<HdStShaderCodePtr> _dirtyShaders;
185 std::unique_ptr<class HdSt_SamplerObjectRegistry> _samplerObjectRegistry;
186 std::unique_ptr<class HdSt_TextureObjectRegistry> _textureObjectRegistry;
187 std::unique_ptr<_TextureToHandlesMap> _textureToHandlesMap;
HDST_API std::set< HdStShaderCodeSharedPtr > Commit()
std::shared_ptr< class HdStShaderCode > HdStShaderCodeSharedPtr
HDST_API HdStTextureHandleSharedPtr AllocateTextureHandle(const HdStTextureIdentifier &textureId, HdTextureType textureType, const HdSamplerParameters &samplerParams, size_t memoryRequest, HdStShaderCodePtr const &shaderCode)
std::weak_ptr< class HdStShaderCode > HdStShaderCodePtr
std::weak_ptr< class HdStTextureHandle > HdStTextureHandlePtr
HDST_API ~HdSt_TextureHandleRegistry()
HDST_API void MarkDirty(HdStTextureObjectPtr const &texture)
HDST_API void MarkSamplerGarbageCollectionNeeded()
HDST_API size_t GetNumberOfTextureHandles() const
HdSt_SamplerObjectRegistry * GetSamplerObjectRegistry() const
HDST_API HdSt_TextureHandleRegistry(HdStResourceRegistry *registry)
std::shared_ptr< class HdStTextureObject > HdStTextureObjectSharedPtr
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
std::shared_ptr< class HdStTextureHandle > HdStTextureHandleSharedPtr
HdSt_TextureObjectRegistry * GetTextureObjectRegistry() const
#define PXR_NAMESPACE_CLOSE_SCOPE
std::shared_ptr< class HdStSamplerObject > HdStSamplerObjectSharedPtr
std::weak_ptr< class HdStTextureObject > HdStTextureObjectPtr
HDST_API void SetMemoryRequestForTextureType(HdTextureType textureType, size_t memoryRequest)