Loading...
Searching...
No Matches
HdStTextureObject Class Referenceabstract

Base class for a texture object. More...

#include <textureObject.h>

+ Inheritance diagram for HdStTextureObject:

Public Member Functions

const HdStTextureIdentifierGetTextureIdentifier () const
 Get texture identifier.
 
size_t GetTargetMemory () const
 Get the target memory for the texture.
 
HDST_API void SetTargetMemory (size_t)
 Set the target memory (in bytes).
 
virtual HDST_API bool IsValid () const =0
 Is texture valid? Only correct after commit phase.
 
virtual HDST_API HdTextureType GetTextureType () const =0
 Get texture type.
 

Protected Member Functions

 HdStTextureObject (const HdStTextureIdentifier &textureId, HdSt_TextureObjectRegistry *textureObjectRegistry)
 
HDST_API HdStResourceRegistry_GetResourceRegistry () const
 
HDST_API Hgi_GetHgi () const
 
HDST_API std::string _GetDebugName (const HdStTextureIdentifier &textureId) const
 
HDST_API bool _GetPremultiplyAlpha (const HdStSubtextureIdentifier *const subId) const
 
HDST_API HioImage::SourceColorSpace _GetSourceColorSpace (const HdStSubtextureIdentifier *const subId) const
 
virtual HDST_API void _Load ()=0
 Load texture to CPU (thread-safe)
 
virtual HDST_API void _Commit ()=0
 Commit texture to GPU (not thread-safe)
 
HDST_API void _AdjustTotalTextureMemory (int64_t memDiff)
 Add signed number to total texture memory amount maintained by registry.
 
HDST_API void _AddToTotalTextureMemory (const HgiTextureHandle &texture)
 Compute memory of texture and add to total texture memory amount maintained by registry.
 
HDST_API void _SubtractFromTotalTextureMemory (const HgiTextureHandle &texture)
 Compute memory of texture and subtract to total texture memory amount maintained by registry.
 

Detailed Description

Base class for a texture object.

The actual GPU resources will be allocated during the commit phase.

Definition at line 58 of file textureObject.h.

Member Function Documentation

◆ _AddToTotalTextureMemory()

HDST_API void _AddToTotalTextureMemory ( const HgiTextureHandle texture)
protected

Compute memory of texture and add to total texture memory amount maintained by registry.

◆ _AdjustTotalTextureMemory()

HDST_API void _AdjustTotalTextureMemory ( int64_t  memDiff)
protected

Add signed number to total texture memory amount maintained by registry.

◆ _Commit()

virtual HDST_API void _Commit ( )
protectedpure virtual

Commit texture to GPU (not thread-safe)

Implemented in HdStDynamicUvTextureObject, HdStPtexTextureObject, HdStFieldTextureObject, and HdStUdimTextureObject.

◆ _Load()

virtual HDST_API void _Load ( )
protectedpure virtual

Load texture to CPU (thread-safe)

Implemented in HdStDynamicUvTextureObject, HdStPtexTextureObject, HdStFieldTextureObject, and HdStUdimTextureObject.

◆ _SubtractFromTotalTextureMemory()

HDST_API void _SubtractFromTotalTextureMemory ( const HgiTextureHandle texture)
protected

Compute memory of texture and subtract to total texture memory amount maintained by registry.

◆ GetTargetMemory()

size_t GetTargetMemory ( ) const
inline

Get the target memory for the texture.

Definition at line 69 of file textureObject.h.

◆ GetTextureIdentifier()

const HdStTextureIdentifier & GetTextureIdentifier ( ) const
inline

Get texture identifier.

Definition at line 65 of file textureObject.h.

◆ GetTextureType()

virtual HDST_API HdTextureType GetTextureType ( ) const
pure virtual

◆ IsValid()

virtual HDST_API bool IsValid ( ) const
pure virtual

Is texture valid? Only correct after commit phase.

E.g., no file at given file path. Consulted by clients to determine whether to use the fallback value.

Implemented in HdStDynamicUvTextureObject, HdStPtexTextureObject, HdStFieldTextureObject, and HdStUdimTextureObject.

◆ SetTargetMemory()

HDST_API void SetTargetMemory ( size_t  )

Set the target memory (in bytes).

When uploading the texture to the GPU, it will be downsampled to meet this target memory.


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