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

#include <samplerObjectRegistry.h>

Public Member Functions

HDST_API HdSt_SamplerObjectRegistry (Hgi *hgi)
 
HDST_API ~HdSt_SamplerObjectRegistry ()
 
HDST_API HdStSamplerObjectSharedPtr AllocateSampler (HdStTextureObjectSharedPtr const &texture, HdSamplerParameters const &samplerParameters, bool createBindlessHandle)
 
HDST_API void GarbageCollect ()
 Delete samplers no longer used by a client. More...
 
HDST_API HgiGetHgi () const
 

Detailed Description

A simple registry for GPU samplers and GL texture sampler handles (for bindless textures).

The registry makes no attempt at de-duplication. But construction is dispatched by texture type returing a matching sampler (e.g., HdStFieldSamplerObject for a HdStFieldTextureObject or HdStPtexSamplerObject for the (not yet existing) HdStPtexTextureObject). Also, it keeps a shared pointer to a sampler around until garbage collection so that clients can safely drop their shared pointers from different threads.

Definition at line 55 of file samplerObjectRegistry.h.

Constructor & Destructor Documentation

HDST_API HdSt_SamplerObjectRegistry::HdSt_SamplerObjectRegistry ( Hgi hgi)
explicit
HDST_API HdSt_SamplerObjectRegistry::~HdSt_SamplerObjectRegistry ( )

Member Function Documentation

HDST_API HdStSamplerObjectSharedPtr HdSt_SamplerObjectRegistry::AllocateSampler ( HdStTextureObjectSharedPtr const texture,
HdSamplerParameters const samplerParameters,
bool  createBindlessHandle 
)

Create new sampler object matching the given texture object.

If createBindlessHandle, also creates a texture sampler handle (for bindless textures). The associated GPU resource is created immediately and the call is not thread-safe.

HDST_API void HdSt_SamplerObjectRegistry::GarbageCollect ( )

Delete samplers no longer used by a client.

HDST_API Hgi* HdSt_SamplerObjectRegistry::GetHgi ( ) const
inline

Get Hgi instance

Definition at line 82 of file samplerObjectRegistry.h.


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