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

Swap chain description. More...

#include <GraphicsTypes.h>

Public Member Functions

constexpr SwapChainDesc (Uint32 _Width, Uint32 _Height, TEXTURE_FORMAT _ColorBufferFormat, TEXTURE_FORMAT _DepthBufferFormat, Uint32 _BufferCount=SwapChainDesc{}.BufferCount, Float32 _DefaultDepthValue=SwapChainDesc{}.DefaultDepthValue, Uint8 _DefaultStencilValue=SwapChainDesc{}.DefaultStencilValue, Bool _IsPrimary=SwapChainDesc{}.IsPrimary)
 Constructor initializes the structure members with default values.
 

Public Attributes

Uint32 Width = 0
 The swap chain width. Default value is 0.
 
Uint32 Height = 0
 The swap chain height. Default value is 0.
 
TEXTURE_FORMAT ColorBufferFormat = TEX_FORMAT_RGBA8_UNORM_SRGB
 Back buffer format. Default value is Diligent::TEX_FORMAT_RGBA8_UNORM_SRGB.
 
TEXTURE_FORMAT DepthBufferFormat = TEX_FORMAT_D32_FLOAT
 
SWAP_CHAIN_USAGE_FLAGS Usage = SWAP_CHAIN_USAGE_RENDER_TARGET
 Swap chain usage flags. Default value is Diligent::SWAP_CHAIN_USAGE_RENDER_TARGET.
 
SURFACE_TRANSFORM PreTransform = SURFACE_TRANSFORM_OPTIMAL
 
Uint32 BufferCount = 2
 The number of buffers in the swap chain.
 
Float32 DefaultDepthValue = 1.f
 Default depth value, which is used as optimized depth clear value in D3D12.
 
Uint8 DefaultStencilValue = 0
 Default stencil value, which is used as optimized stencil clear value in D3D12.
 
Bool IsPrimary = true
 

Detailed Description

Swap chain description.

Member Data Documentation

◆ DepthBufferFormat

TEXTURE_FORMAT Diligent::SwapChainDesc::DepthBufferFormat = TEX_FORMAT_D32_FLOAT

Depth buffer format. Default value is Diligent::TEX_FORMAT_D32_FLOAT. Use Diligent::TEX_FORMAT_UNKNOWN to create the swap chain without depth buffer.

◆ IsPrimary

Bool Diligent::SwapChainDesc::IsPrimary = true

Indicates if this is a primary swap chain. When Present() is called for the primary swap chain, the engine releases stale resources.

◆ PreTransform

SURFACE_TRANSFORM Diligent::SwapChainDesc::PreTransform = SURFACE_TRANSFORM_OPTIMAL

The transform, relative to the presentation engine's natural orientation, applied to the image content prior to presentation.

When default value (SURFACE_TRANSFORM_OPTIMAL) is used, the engine will select the most optimal surface transformation. An application may request specific transform (e.g. SURFACE_TRANSFORM_IDENTITY) and the engine will try to use that. However, if the transform is not available, the engine will select the most optimal transform. After the swap chain has been created, this member will contain the actual transform selected by the engine and can be queried through ISwapChain::GetDesc() method.