Loading...
Searching...
No Matches
HgiGLTexture Class Referencefinal

Represents a OpenGL GPU texture resource. More...

#include <texture.h>

+ Inheritance diagram for HgiGLTexture:

Public Member Functions

HGIGL_API size_t GetByteSizeOfResource () const override
 Returns the byte size of the GPU texture.
 
HGIGL_API uint64_t GetRawResource () const override
 This function returns the handle to the Hgi backend's gpu resource, cast to a uint64_t.
 
uint32_t GetTextureId () const
 Returns the OpenGL id / name of the texture.
 
HGIGL_API uint64_t GetBindlessHandle ()
 Returns the bindless gpu handle (caller must verify extension support)
 
HGIGL_API void SubmitLayoutChange (HgiTextureUsage newLayout) override
 This function does not do anything.
 
- Public Member Functions inherited from HgiTexture
HGI_API HgiTextureDesc const & GetDescriptor () const
 The descriptor describes the object.
 
virtual HGI_API size_t GetByteSizeOfResource () const =0
 Returns the byte size of the GPU texture.
 
virtual HGI_API uint64_t GetRawResource () const =0
 This function returns the handle to the Hgi backend's gpu resource, cast to a uint64_t.
 
virtual HGI_API void SubmitLayoutChange (HgiTextureUsage newLayout)=0
 This function initiates a layout change process on this texture resource.
 
- Public Member Functions inherited from TfWeakBase
 TfWeakBase (const TfWeakBase &)
 
const TfWeakBase__GetTfWeakBase__ () const
 
const TfWeakBaseoperator= (const TfWeakBase &)
 
void EnableNotification2 () const
 
TF_API void const * GetUniqueIdentifier () const
 

Protected Member Functions

HGIGL_API HgiGLTexture (HgiTextureDesc const &desc)
 
HGIGL_API HgiGLTexture (HgiTextureViewDesc const &desc)
 
- Protected Member Functions inherited from HgiTexture
HGI_API HgiTexture (HgiTextureDesc const &desc)
 
- Protected Member Functions inherited from TfWeakBase
TfRefPtr< Tf_Remnant > _Register () const
 
template<class T >
TfRefPtr< Tf_Remnant > _Register (T *tempRmnt) const
 
bool _HasRemnant () const
 

Friends

class HgiGL
 

Additional Inherited Members

- Static Protected Member Functions inherited from HgiTexture
static HGI_API size_t _GetByteSizeOfResource (const HgiTextureDesc &descriptor)
 
- Protected Attributes inherited from HgiTexture
HgiTextureDesc _descriptor
 

Detailed Description

Represents a OpenGL GPU texture resource.

Note that we inherit from TfWeakBase for deletion detection. This is useful to invalidate container objects such as framebuffer objects that reference a deleted texture resource as an attachment.

Definition at line 47 of file texture.h.

Member Function Documentation

◆ GetBindlessHandle()

HGIGL_API uint64_t GetBindlessHandle ( )

Returns the bindless gpu handle (caller must verify extension support)

◆ GetByteSizeOfResource()

HGIGL_API size_t GetByteSizeOfResource ( ) const
overridevirtual

Returns the byte size of the GPU texture.

This can be helpful if the application wishes to tally up memory usage.

Implements HgiTexture.

◆ GetRawResource()

HGIGL_API uint64_t GetRawResource ( ) const
overridevirtual

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.

Implements HgiTexture.

◆ GetTextureId()

uint32_t GetTextureId ( ) const
inline

Returns the OpenGL id / name of the texture.

Definition at line 60 of file texture.h.

◆ SubmitLayoutChange()

HGIGL_API void SubmitLayoutChange ( HgiTextureUsage  newLayout)
overridevirtual

This function does not do anything.

There is no support for explicit layout transition in non-explicit APIs like OpenGL. Hence this function simply returns void.

Implements HgiTexture.

Friends And Related Function Documentation

◆ HgiGL

friend class HgiGL
friend

Definition at line 73 of file texture.h.


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