HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HdSt_TextureHandleRegistry Class Referencefinal

#include <textureHandleRegistry.h>

Public Member Functions

HDST_API HdSt_TextureHandleRegistry (HdStResourceRegistry *registry)
 
HDST_API ~HdSt_TextureHandleRegistry ()
 
HDST_API HdStTextureHandleSharedPtr AllocateTextureHandle (const HdStTextureIdentifier &textureId, HdTextureType textureType, const HdSamplerParameters &samplerParams, size_t memoryRequest, HdStShaderCodePtr const &shaderCode)
 
HDST_API void MarkDirty (HdStTextureObjectPtr const &texture)
 
HDST_API void MarkDirty (HdStShaderCodePtr const &shader)
 
HDST_API void MarkSamplerGarbageCollectionNeeded ()
 
HdSt_TextureObjectRegistryGetTextureObjectRegistry () const
 
HdSt_SamplerObjectRegistryGetSamplerObjectRegistry () const
 
HDST_API std::set
< HdStShaderCodeSharedPtr
Commit ()
 
HDST_API void SetMemoryRequestForTextureType (HdTextureType textureType, size_t memoryRequest)
 
HDST_API size_t GetNumberOfTextureHandles () const
 

Detailed Description

Keeps track of texture handles and allocates the textures and samplers using the HdSt_TextureObjectRegistry, respectively, HdSt_SamplerObjectRegistry. Its responsibilities including tracking what texture handles are associated to a texture, computing the target memory of a texture from the memory requests in the texture handles, triggering sampler and texture garbage collection, and determining what HdStShaderCode instances are affecting by (re-)committing a texture.

Definition at line 72 of file textureHandleRegistry.h.

Constructor & Destructor Documentation

HDST_API HdSt_TextureHandleRegistry::HdSt_TextureHandleRegistry ( HdStResourceRegistry registry)
explicit
HDST_API HdSt_TextureHandleRegistry::~HdSt_TextureHandleRegistry ( )

Member Function Documentation

HDST_API HdStTextureHandleSharedPtr HdSt_TextureHandleRegistry::AllocateTextureHandle ( const HdStTextureIdentifier textureId,
HdTextureType  textureType,
const HdSamplerParameters samplerParams,
size_t  memoryRequest,
HdStShaderCodePtr const shaderCode 
)

Allocate texture handle (thread-safe).

See HdStResourceRegistry::AllocateTextureHandle for details.

Parameters
memoryRequestmemoryRequest in bytes.
HDST_API std::set<HdStShaderCodeSharedPtr> HdSt_TextureHandleRegistry::Commit ( )

Commit textures. Return shader code instances that depend on the (re-)loaded textures so that they can add buffer sources based on the texture meta-data.

Also garbage collect textures and samplers if necessary.

HDST_API size_t HdSt_TextureHandleRegistry::GetNumberOfTextureHandles ( ) const
HdSt_SamplerObjectRegistry* HdSt_TextureHandleRegistry::GetSamplerObjectRegistry ( ) const
inline

Get sampler object registry.

Definition at line 126 of file textureHandleRegistry.h.

HdSt_TextureObjectRegistry* HdSt_TextureHandleRegistry::GetTextureObjectRegistry ( ) const
inline

Get texture object registry.

Definition at line 120 of file textureHandleRegistry.h.

HDST_API void HdSt_TextureHandleRegistry::MarkDirty ( HdStTextureObjectPtr const texture)

Mark texture dirty (thread-safe).

If set, the target memory of the texture will be recomputed during commit and the data structure tracking the associated handles will be updated potentially triggering texture garbage collection.

HDST_API void HdSt_TextureHandleRegistry::MarkDirty ( HdStShaderCodePtr const shader)

Mark shader dirty (thread-safe).

If set, the shader is scheduled to be updated (i.e., have its AddResourcesFromTextures called) on the next commit.

HDST_API void HdSt_TextureHandleRegistry::MarkSamplerGarbageCollectionNeeded ( )

Mark that sampler garbage collection needs to happen during next commit (thead-safe).

HDST_API void HdSt_TextureHandleRegistry::SetMemoryRequestForTextureType ( HdTextureType  textureType,
size_t  memoryRequest 
)

Sets how much memory a single texture can consume in bytes by texture type.

Only has an effect if non-zero and only applies to textures if no texture handle referencing the texture has a memory request.


The documentation for this class was generated from the following file: