Loading...
Searching...
No Matches
HgiTextureView Class Reference

Represents a graphics platform independent GPU texture view resource. More...

#include <texture.h>

Public Member Functions

HGI_API HgiTextureView (HgiTextureViewDesc const &desc)
 
HGI_API void SetViewTexture (HgiTextureHandle const &handle)
 Set the handle to the texture that aliases another texture.
 
HGI_API HgiTextureHandle const & GetViewTexture () const
 Returns the handle to the texture that aliases another texture.
 

Protected Attributes

HgiTextureHandle _viewTexture
 

Detailed Description

Represents a graphics platform independent GPU texture view resource.

Texture Views should be created via Hgi::CreateTextureView.

A TextureView aliases the data of another texture and is a thin wrapper around a HgiTextureHandle. The embeded texture handle is used to add the texture to resource bindings for use in shaders.

For example when using a compute shader to fill the mip levels of a texture, like a lightDome texture, we can use a texture view to give the shader access to a specific mip level of a sourceTexture via a TextureView.

Another example is to conserve resources by reusing a RGBAF32 texture as a RGBAI32 texture once the F32 texture is no longer needed (transient resources).

Definition at line 292 of file texture.h.

Member Function Documentation

◆ GetViewTexture()

HGI_API HgiTextureHandle const & GetViewTexture ( ) const

Returns the handle to the texture that aliases another texture.

◆ SetViewTexture()

HGI_API void SetViewTexture ( HgiTextureHandle const &  handle)

Set the handle to the texture that aliases another texture.

Member Data Documentation

◆ _viewTexture

HgiTextureHandle _viewTexture
protected

Definition at line 310 of file texture.h.


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