HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HgiTexture Class Referenceabstract

#include <texture.h>

+ Inheritance diagram for HgiTexture:

Public Member Functions

virtual HGI_API ~HgiTexture ()
 
HGI_API HgiTextureDesc constGetDescriptor () const
 The descriptor describes the object. More...
 
virtual HGI_API size_t GetByteSizeOfResource () const =0
 
virtual HGI_API uint64_t GetRawResource () const =0
 

Protected Member Functions

HGI_API HgiTexture (HgiTextureDesc const &desc)
 

Static Protected Member Functions

static HGI_API size_t _GetByteSizeOfResource (const HgiTextureDesc &descriptor)
 

Protected Attributes

HgiTextureDesc _descriptor
 

Detailed Description

Represents a graphics platform independent GPU texture resource. Textures should be created via Hgi::CreateTexture.

Base class for Hgi textures. To the client (HdSt) texture resources are referred to via opaque, stateless handles (HgTextureHandle).

Definition at line 160 of file texture.h.

Constructor & Destructor Documentation

virtual HGI_API HgiTexture::~HgiTexture ( )
virtual
HGI_API HgiTexture::HgiTexture ( HgiTextureDesc const desc)
protected

Member Function Documentation

static HGI_API size_t HgiTexture::_GetByteSizeOfResource ( const HgiTextureDesc descriptor)
staticprotected
virtual HGI_API size_t HgiTexture::GetByteSizeOfResource ( ) const
pure virtual

Returns the byte size of the GPU texture. This can be helpful if the application wishes to tally up memory usage.

Implemented in HgiGLTexture.

HGI_API HgiTextureDesc const& HgiTexture::GetDescriptor ( ) const

The descriptor describes the object.

virtual HGI_API uint64_t HgiTexture::GetRawResource ( ) const
pure virtual

This function returns the handle to the Hgi backend's gpu resource, cast to a uint64_t. Clients should avoid using this function and instead use Hgi base classes so that client code works with any Hgi platform. For transitioning code to Hgi, it can however we useful to directly access a platform's internal resource handles. There is no safety provided in using this. If you by accident pass a HgiMetal resource into an OpenGL call, bad things may happen. In OpenGL this returns the GLuint resource name. In Metal this returns the id<MTLTexture> as uint64_t. In Vulkan this returns the VkImage as uint64_t. In DX12 this returns the ID3D12Resource pointer as uint64_t.

Implemented in HgiGLTexture.

Member Data Documentation

HgiTextureDesc HgiTexture::_descriptor
protected

Definition at line 197 of file texture.h.


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