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

Texture view descriptor structure. More...

#include <TextureFlags.h>

Public Attributes

TextureType type = TextureType::Texture2D
 Hardware texture type. By default TextureType::Texture2D.
Format format = Format::RGBA8UNorm
 Hardware texture format. By default Format::RGBA8UNorm.
TextureSubresource subresource
 Specifies the texture subresource, i.e. MIP-map level and array layer range. By default only the first MIP-map level and first array layer is addressed.
TextureSwizzleRGBA swizzle
 Specifies the color component mapping. Each component is mapped to its identity by default.

Detailed Description

Texture view descriptor structure.

Remarks
Contains all information about type, format, and dimension to create a texture view that shares the image data of another texture resource.
See also
ResourceViewDescriptor::textureView
RenderingFeatures::hasTextureViews

Member Data Documentation

◆ format

Format LLGL::TextureViewDescriptor::format = Format::RGBA8UNorm

Hardware texture format. By default Format::RGBA8UNorm.

Remarks
The format of the parent texture and the texture view must be in the same format class. There are two classes of format compatibility between the texture view and its parent texture. What class of formats is supported for texture views depends on whether the backend supports format swizzling (see RenderingFeatures::hasTextureViewFormatSwizzle).
Format compatibility classes for backends that do support format swizzling:
Class Compatible texture formats
128 Bits Format::RGBA32UInt, Format::RGBA32SInt, Format::RGBA32Float
96 Bits Format::RGB32UInt, Format::RGB32SInt, Format::RGB32Float
64 Bits Format::RG32UInt, Format::RG32SInt, Format::RG32Float, Format::RGBA16UNorm, Format::RGBA16SNorm, Format::RGBA16UInt, Format::RGBA16SInt, Format::RGBA16Float
48 Bits Format::RGB16UNorm, Format::RGB16SNorm, Format::RGB16UInt, Format::RGB16SInt, Format::RGB16Float
32 Bits Format::R32UInt, Format::R32SInt, Format::R32Float, Format::RG16UNorm, Format::RG16SNorm, Format::RG16UInt, Format::RG16SInt, Format::RG16Float, Format::RGBA8UNorm, Format::RGBA8SNorm, Format::RGBA8UInt, Format::RGBA8SInt
24 Bits Format::RGB8UNorm, Format::RGB8SNorm, Format::RGB8UInt, Format::RGB8SInt
16 Bits Format::R16UNorm, Format::R16SNorm, Format::R16UInt, Format::R16SInt, Format::R16Float, Format::RG8UNorm, Format::RG8SNorm, Format::RG8UInt, Format::RG8SInt
8 Bits Format::R8UNorm, Format::R8SNorm, Format::R8UInt, Format::R8SInt
Format compatibility classes for backends that do not support format swizzling:
Class Compatible texture formats
RGBA 128 Bits Format::RGBA32UInt, Format::RGBA32SInt, Format::RGBA32Float
RGBA 64 Bits Format::RGBA16UNorm, Format::RGBA16SNorm, Format::RGBA16UInt, Format::RGBA16SInt, Format::RGBA16Float
RG 64 Bits Format::RG32UInt, Format::RG32SInt, Format::RG32Float
RGBA 32 Bits Format::RGBA8UNorm, Format::RGBA8SNorm, Format::RGBA8UInt, Format::RGBA8SInt
RG 32 Bits Format::RG16UNorm, Format::RG16SNorm, Format::RG16UInt, Format::RG16SInt, Format::RG16Float
R 32 Bits Format::R32UInt, Format::R32SInt, Format::R32Float
RG 16 Bits Format::RG8UNorm, Format::RG8SNorm, Format::RG8UInt, Format::RG8SInt
R 16 Bits Format::R16UNorm, Format::R16SNorm, Format::R16UInt, Format::R16SInt, Format::R16Float
R 8 Bits Format::R8UNorm, Format::R8SNorm, Format::R8UInt, Format::R8SInt
See also
RenderingFeatures::hasTextureViewFormatSwizzle

◆ subresource

TextureSubresource LLGL::TextureViewDescriptor::subresource

Specifies the texture subresource, i.e. MIP-map level and array layer range. By default only the first MIP-map level and first array layer is addressed.

Remarks
For texture subresources that are bound with the binding flag BindFlags::Storage, numMipLevels must be 1.

◆ swizzle

TextureSwizzleRGBA LLGL::TextureViewDescriptor::swizzle

Specifies the color component mapping. Each component is mapped to its identity by default.

Remarks
If texture swizzling is not supported, this must be equal to the default value.
Note
Only supported with: OpenGL, Vulkan, Metal, Direct3D 12.
See also
RenderingFeatures::hasTextureViewSwizzle
IsTextureSwizzleIdentity

◆ type


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