Loading...
Searching...
No Matches
HdStDynamicUvTextureObject Class Referencefinal

A uv texture that is managed but not populated by the Storm texture system. More...

#include <dynamicUvTextureObject.h>

+ Inheritance diagram for HdStDynamicUvTextureObject:

Public Member Functions

HDST_API HdStDynamicUvTextureObject (const HdStTextureIdentifier &textureId, HdSt_TextureObjectRegistry *textureObjectRegistry)
 
void CreateTexture (const HgiTextureDesc &desc)
 Allocate GPU resource using the texture descriptor.
 
void GenerateMipmaps ()
 Make GPU generate mipmaps.
 
void DestroyTexture ()
 Release GPU resource.
 
void SetWrapParameters (const std::pair< HdWrap, HdWrap > &wrapParameters)
 Set wrap mode hints used when a texture node's wrap mode is use metadata.
 
void SetCpuData (std::unique_ptr< HdStTextureCpuData > &&cpuData)
 Save CPU data for this texture (transfering ownership).
 
HdStTextureCpuDataGetCpuData () const
 Get the CPU data stored for this texture.
 
HDST_API bool IsValid () const override
 Always returns true - so that samplers for this texture are created.
 
- Public Member Functions inherited from HdStUvTextureObject
HgiTextureHandle const & GetTexture () const
 Get the handle to the actual GPU resource.
 
const std::pair< HdWrap, HdWrap > & GetWrapParameters () const
 Opinion about wrapS and wrapT parameters from the texture file.
 
HDST_API HdTextureType GetTextureType () const override final
 Get texture type.
 
- Public Member Functions inherited from HdStTextureObject
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

HDST_API void _Load () override
 Load texture to CPU (thread-safe)
 
HDST_API void _Commit () override
 Commit texture to GPU (not thread-safe)
 
- Protected Member Functions inherited from HdStUvTextureObject
 HdStUvTextureObject (const HdStTextureIdentifier &textureId, HdSt_TextureObjectRegistry *textureObjectRegistry)
 
void _SetWrapParameters (const std::pair< HdWrap, HdWrap > &wrapParameters)
 
void _SetCpuData (std::unique_ptr< HdStTextureCpuData > &&)
 
HdStTextureCpuData_GetCpuData () const
 
void _CreateTexture (const HgiTextureDesc &desc)
 
void _GenerateMipmaps ()
 
void _DestroyTexture ()
 
- Protected Member Functions inherited from HdStTextureObject
 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

A uv texture that is managed but not populated by the Storm texture system.

Clients can allocate an instance of this class through HdStResourceRegistry::AllocateTextureHandle or AllocateTextureObject by passing an HdStTextureIdentifier with a HdStDynamicUvSubtextureIdentifier.

The client can allocate the GPU resource with CreateTexture and populate it by either giving data in the HgiTextureDesc or binding the texture as target for a computation or render.

Bindless texture sampler handles can only be created correctly if a client has created the texture before the texture commit phase is finished.

Definition at line 53 of file dynamicUvTextureObject.h.

Member Function Documentation

◆ _Commit()

HDST_API void _Commit ( )
overrideprotectedvirtual

Commit texture to GPU (not thread-safe)

Implements HdStTextureObject.

◆ _Load()

HDST_API void _Load ( )
overrideprotectedvirtual

Load texture to CPU (thread-safe)

Implements HdStTextureObject.

◆ CreateTexture()

void CreateTexture ( const HgiTextureDesc desc)
inline

Allocate GPU resource using the texture descriptor.

Populate if data are given in the descriptor.

Definition at line 67 of file dynamicUvTextureObject.h.

◆ DestroyTexture()

void DestroyTexture ( )
inline

Release GPU resource.

Definition at line 79 of file dynamicUvTextureObject.h.

◆ GenerateMipmaps()

void GenerateMipmaps ( )
inline

Make GPU generate mipmaps.

Definition at line 73 of file dynamicUvTextureObject.h.

◆ GetCpuData()

HdStTextureCpuData * GetCpuData ( ) const
inline

Get the CPU data stored for this texture.

Typically used in HdStDynamicUvTextureImplementation::Commit to commit CPU data to GPU.

Definition at line 107 of file dynamicUvTextureObject.h.

◆ IsValid()

HDST_API bool IsValid ( ) const
overridevirtual

Always returns true - so that samplers for this texture are created.

Implements HdStTextureObject.

◆ SetCpuData()

void SetCpuData ( std::unique_ptr< HdStTextureCpuData > &&  cpuData)
inline

Save CPU data for this texture (transfering ownership).

This is typically called from HdStDynamicUvTextureImplementation::Load so that the CPU data can be uploaded during commit.

To free the CPU data, call with nullptr.

Definition at line 99 of file dynamicUvTextureObject.h.

◆ SetWrapParameters()

void SetWrapParameters ( const std::pair< HdWrap, HdWrap > &  wrapParameters)
inline

Set wrap mode hints used when a texture node's wrap mode is use metadata.

This is typically called from HdStDynamicUvTextureImplementation::Load when the texture file has wrap mode hints.

Definition at line 88 of file dynamicUvTextureObject.h.


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