Diligent Engine
 
Loading...
Searching...
No Matches
Diligent::TextureDesc Struct Reference

Texture description. More...

#include <Texture.h>

Inheritance diagram for Diligent::TextureDesc:
Diligent::DeviceObjectAttribs

Public Member Functions

constexpr bool operator== (const TextureDesc &RHS) const
 Tests if two texture descriptions are equal.
 

Public Attributes

RESOURCE_DIMENSION Type = RESOURCE_DIM_UNDEFINED
 Texture type. See Diligent::RESOURCE_DIMENSION for details.
 
Uint32 Width = 0
 Texture width, in pixels.
 
Uint32 Height = 0
 Texture height, in pixels.
 
TEXTURE_FORMAT Format = TEX_FORMAT_UNKNOWN
 Texture format, see Diligent::TEXTURE_FORMAT.
 
Uint32 MipLevels = 1
 Number of Mip levels in the texture. Multisampled textures can only have 1 Mip level.
 
Uint32 SampleCount = 1
 The number of samples.
 
BIND_FLAGS BindFlags = BIND_NONE
 Bind flags, see Diligent::BIND_FLAGS for details.
 
USAGE Usage = USAGE_DEFAULT
 Texture usage. See Diligent::USAGE for details.
 
CPU_ACCESS_FLAGS CPUAccessFlags = CPU_ACCESS_NONE
 CPU access flags or 0 if no CPU access is allowed,.
 
MISC_TEXTURE_FLAGS MiscFlags = MISC_TEXTURE_FLAG_NONE
 Miscellaneous flags, see Diligent::MISC_TEXTURE_FLAGS for details.
 
OptimizedClearValue ClearValue
 Optimized clear value.
 
Uint64 ImmediateContextMask = 1
 Defines which immediate contexts are allowed to execute commands that use this texture.
 
- Public Attributes inherited from Diligent::DeviceObjectAttribs
const Char * Name = nullptr
 Object name.
 

Detailed Description

Texture description.

Member Function Documentation

◆ operator==()

bool Diligent::TextureDesc::operator== ( const TextureDesc & RHS) const
inlineconstexpr

Tests if two texture descriptions are equal.

Parameters
[in]RHS- reference to the structure to compare with.
Returns
true if all members of the two structures except for the Name are equal, and false otherwise.
Note
The operator ignores the Name field as it is used for debug purposes and doesn't affect the texture properties.

Member Data Documentation

◆ BindFlags

BIND_FLAGS Diligent::TextureDesc::BindFlags = BIND_NONE

Bind flags, see Diligent::BIND_FLAGS for details.

Use IRenderDevice::GetTextureFormatInfoExt() to check which bind flags are supported.

◆ CPUAccessFlags

CPU_ACCESS_FLAGS Diligent::TextureDesc::CPUAccessFlags = CPU_ACCESS_NONE

CPU access flags or 0 if no CPU access is allowed,.

see Diligent::CPU_ACCESS_FLAGS for details.

◆ Format

TEXTURE_FORMAT Diligent::TextureDesc::Format = TEX_FORMAT_UNKNOWN

Texture format, see Diligent::TEXTURE_FORMAT.

Use IRenderDevice::GetTextureFormatInfo() to check if format is supported.

◆ ImmediateContextMask

Uint64 Diligent::TextureDesc::ImmediateContextMask = 1

Defines which immediate contexts are allowed to execute commands that use this texture.

When ImmediateContextMask contains a bit at position n, the texture may be used in the immediate context with index n directly (see DeviceContextDesc::ContextId). It may also be used in a command list recorded by a deferred context that will be executed through that immediate context.

Remarks
Only specify these bits that will indicate those immediate contexts where the texture will actually be used. Do not set unnecessary bits as this will result in extra overhead.

◆ MipLevels

Uint32 Diligent::TextureDesc::MipLevels = 1

Number of Mip levels in the texture. Multisampled textures can only have 1 Mip level.

Specify 0 to create full mipmap chain.

◆ SampleCount

Uint32 Diligent::TextureDesc::SampleCount = 1

The number of samples.

Only 2D textures or 2D texture arrays can be multisampled.