Visual Computing Library
Loading...
Searching...
No Matches
vcl::TextureBuffer Class Reference
Inheritance diagram for vcl::TextureBuffer:

Public Member Functions

void swap (TextureBuffer &other)
 Swap the content of this object with another TextureBuffer object.
 
void create (ushort width, ushort height, bgfx::TextureFormat::Enum format, uint64_t flags=BGFX_TEXTURE_NONE, bool hasMips=false, uint nLayers=1, const bgfx::Memory *data=nullptr)
 Creates the texture buffer and sets the data (if given) for compute shaders.
 
void bind (uint stage, bgfx::Access::Enum access=bgfx::Access::Read, uint8_t mipLevel=0) const
 Bind the texture buffer to the compute shader.
 

Private Types

using Base = GenericBuffer< bgfx::TextureHandle >
 

Private Attributes

bgfx::TextureFormat::Enum mFormat = bgfx::TextureFormat::Count
 

Friends

void swap (TextureBuffer &a, TextureBuffer &b)
 

Member Function Documentation

◆ bind()

void vcl::TextureBuffer::bind ( uint  stage,
bgfx::Access::Enum  access = bgfx::Access::Read,
uint8_t  mipLevel = 0 
) const
inline

Bind the texture buffer to the compute shader.

If the texture buffer is valid, it is bound to the compute shader with the specified stage and the given access type (Read, Write, Read Write). If the texture buffer is not valid, nothing happens.

Parameters
[in]stagethe stage to which the buffer is bound.
[in]accessthe access type for the buffer.
[in]mipLevelthe mip level of the texture.

◆ create()

void vcl::TextureBuffer::create ( ushort  width,
ushort  height,
bgfx::TextureFormat::Enum  format,
uint64_t  flags = BGFX_TEXTURE_NONE,
bool  hasMips = false,
uint  nLayers = 1,
const bgfx::Memory *  data = nullptr 
)
inline

Creates the texture buffer and sets the data (if given) for compute shaders.

If the buffer is already created (isValid() returns true), it is destroyed and a new one is created.

Parameters
[in]widththe width of the texture.
[in]heightthe height of the texture.
[in]formatthe format of the texture.
[in]flagsthe flags for the texture.
[in]hasMipsif true, the texture has mipmaps.
[in]nLayersthe number of layers of the texture.
[in]datathe memory containing the data.

◆ swap()

void vcl::TextureBuffer::swap ( TextureBuffer other)
inline

Swap the content of this object with another TextureBuffer object.

Parameters
[in]otherthe other TextureBuffer object.

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