LLGL 0.05 Beta
Loading...
Searching...
No Matches
LLGL::TextureDescriptor Struct Reference

Texture descriptor structure. More...

#include <TextureFlags.h>

Public Attributes

const char * debugName = nullptr
 Optional name for debugging purposes. By default null.
TextureType type = TextureType::Texture2D
 Hardware texture type. By default TextureType::Texture2D.
long bindFlags = (BindFlags::Sampled | BindFlags::ColorAttachment)
 These flags describe to which resource slots and render target attachments the texture can be bound. By default BindFlags::Sampled and BindFlags::ColorAttachment.
long cpuAccessFlags = (CPUAccessFlags::Read | CPUAccessFlags::Write)
 CPU read/write access flags. By default CPUAccessFlags::ReadWrite.
long miscFlags = (MiscFlags::FixedSamples | MiscFlags::GenerateMips)
 Miscellaneous texture flags. By default MiscFlags::FixedSamples and MiscFlags::GenerateMips.
Format format = Format::RGBA8UNorm
 Hardware texture format. By default Format::RGBA8UNorm.
Extent3D extent = { 1, 1, 1 }
 Size of the texture (excluding the number of array layers). By default (1, 1, 1).
std::uint32_t arrayLayers = 1
 Number of array layers. By default 1.
std::uint32_t mipLevels = 0
 Number of MIP-map levels. By default 0.
std::uint32_t samples = 1
 Number of samples per texel. By default 1.
ClearValue clearValue
 Specifies a clear value to initialize the texture with, if no initial image data is provided.

Detailed Description

Texture descriptor structure.

Remarks
Contains all information about type, format, and dimension to create a texture resource.
See also
RenderSystem::CreateTexture

Member Data Documentation

◆ arrayLayers

std::uint32_t LLGL::TextureDescriptor::arrayLayers = 1

Number of array layers. By default 1.

Remarks
For array textures and cube textures (i.e. TextureType::Texture1DArray, TextureType::Texture2DArray, TextureType::TextureCube, TextureType::TextureCubeArray, and TextureType::Texture2DMSArray), this must be greater than or equal to 1.
For cube textures (i.e. TextureType::TextureCube and TextureType::TextureCubeArray), this must be a multiple of 6 and greater than zero (one array layer for each cube face).
For all other texture types, this must be 1.
The index offsets for each cube face are as follows:
  • X+ direction has index offset 0.
  • X- direction has index offset 1.
  • Y+ direction has index offset 2.
  • Y- direction has index offset 3.
  • Z+ direction has index offset 4.
  • Z- direction has index offset 5.
See also
IsArrayTexture
IsCubeTexture
RenderingLimits::maxTextureArrayLayers

◆ bindFlags

long LLGL::TextureDescriptor::bindFlags = (BindFlags::Sampled | BindFlags::ColorAttachment)

These flags describe to which resource slots and render target attachments the texture can be bound. By default BindFlags::Sampled and BindFlags::ColorAttachment.

Remarks
When the texture will be bound as a color attachment to a render target for instance, the BindFlags::ColorAttachment flag is required.
See also
BindFlags

◆ clearValue

ClearValue LLGL::TextureDescriptor::clearValue

Specifies a clear value to initialize the texture with, if no initial image data is provided.

Remarks
The initial texture data is only determined by this attribute if the imageDesc parameter of RenderSystem::CreateTexture is null and the MiscFlags::NoInitialData bit is not set in the miscFlags attribute. In either case, this value may be used by the renderer API as a hint which clear value the resource is optimized for (especially for Direct3D 12).
See also
RenderSystem::CreateTexture
TextureDescriptor::miscFlags

◆ cpuAccessFlags

long LLGL::TextureDescriptor::cpuAccessFlags = (CPUAccessFlags::Read | CPUAccessFlags::Write)

CPU read/write access flags. By default CPUAccessFlags::ReadWrite.

Remarks
If this is 0 the texture cannot be mapped between GPU and CPU memory space.
See also
CPUAccessFlags
RenderSystem::ReadTexture
RenderSystem::WriteTexture

◆ debugName

const char* LLGL::TextureDescriptor::debugName = nullptr

Optional name for debugging purposes. By default null.

Remarks
The final name of the native hardware resource is implementation defined.
See also
RenderSystemChild::SetDebugName

◆ extent

Extent3D LLGL::TextureDescriptor::extent = { 1, 1, 1 }

Size of the texture (excluding the number of array layers). By default (1, 1, 1).

Remarks
The height component is only used for 2D, 3D, and Cube textures (i.e. TextureType::Texture2D, TextureType::Texture2DArray, TextureType::Texture3D, TextureType::TextureCube, TextureType::TextureCubeArray, TextureType::Texture2DMS, and TextureType::Texture2DMSArray).
The depth component is only used for 3D textures (i.e. TextureType::Texture3D).
The width and height components must be equal for cube textures (i.e. TextureType::TextureCube and TextureType::TextureCubeArray).
See also
IsCubeTexture

◆ format

Format LLGL::TextureDescriptor::format = Format::RGBA8UNorm

Hardware texture format. By default Format::RGBA8UNorm.

See also
RenderingCapabilities::textureFormats

◆ mipLevels

std::uint32_t LLGL::TextureDescriptor::mipLevels = 0

Number of MIP-map levels. By default 0.

Remarks
If this is 0, the number of MIP-map levels will be determined automatically by the texture type and extent for a full MIP-chain.
If this is 1, no MIP-mapping is used for this texture and it has only a single MIP-map level.
For multi-sampled textures (i.e. TextureType::Texture2DMS, TextureType::Texture2DMSArray), this value must be either 0 or 1, whereas 0 specifies a full MIP-chain which implies 1 for multi-sampled textures.
See also
NumMipLevels
CommandBuffer::GenerateMips

◆ miscFlags

long LLGL::TextureDescriptor::miscFlags = (MiscFlags::FixedSamples | MiscFlags::GenerateMips)

Miscellaneous texture flags. By default MiscFlags::FixedSamples and MiscFlags::GenerateMips.

Remarks
This can be used as a hint for the renderer how frequently the texture will be updated, or whether a multi-sampled texture has fixed sample locations.
See also
MiscFlags

◆ samples

std::uint32_t LLGL::TextureDescriptor::samples = 1

◆ type

TextureType LLGL::TextureDescriptor::type = TextureType::Texture2D

Hardware texture type. By default TextureType::Texture2D.


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