class SwapChain

The FidelityFX Cauldron Framework api/platform-agnostic representation of the swapchain object.

File location: framework/cauldron/framework/inc/render/swapchain.h

Methods

Return type

Description

static SwapChain*

SwapChain instance creation function. Implemented per api/platform to return the correct internal resource type.

ResourceFormat

Returns the swap chain resource’s format.

size_t

Returns the configured backbuffer count for this run.

SwapChainRenderTarget *

Returns the current “SwapChainRenderTarget“.

const ResourceViewInfo

Returns the current back buffer’s render target view “ResourceViewInfo“.

const ResourceViewInfo

GetBackBufferRTV (uint8_t idx) const
Returns the specified back buffer’s render target view “ResourceViewInfo“.

uint8_t

Returns the current back buffer’s index.

const DisplayMode

Returns the swap chain’s configured “DisplayMode“.

const HDRMetadata &

Returns the swap chain’s configured “HDRMetadata“.

void

OnResize (uint32_t width, uint32_t height) = 0
Callback invoked while processing OnResize events.

void

Waits until the last submitted swap chain has finished presenting. Only waits when we run too far ahead.

void

Present () = 0
Executes device presentation of the swapchain.

bool

Indicates if this is a replacement frame interpolation swapchain.

void

GetLastPresentCount (UINT* pLastPresentCount)
Gets the last present count for the swapchain.

void

GetRefreshRate (double* outRefreshRate)
Gets the current refresh rate for the swapchain.

void

DumpSwapChainToFile (std::experimental::filesystem::path filePath) = 0
Creates a screenshot of the current swap chain.

DisplayMode

CheckAndGetDisplayModeRequested (DisplayMode DispMode)
Verifies if requested display mode can be supported.

void

Prepares the HDRMetadata based on the selected display mode for the run.

void

Calculates and sets HDRMetadata and color space information.

SwapChainInternal*

GetImpl () = 0
Gets the internal implementation for api/platform parameter accessors.

const SwapChainInternal*

GetImpl () const = 0

Detailed description

The FidelityFX Cauldron Framework api/platform-agnostic representation of the swapchain object. Interface for all presentation-related interfaces.

Fields

Type

Description

static const wchar_t*

s_SwapChainRTName
The name associated with swapchain resources.

Methods

CreateSwapchain

Copied!

static SwapChain* CreateSwapchain ()

SwapChain instance creation function. Implemented per api/platform to return the correct internal resource type.


GetSwapChainFormat

Copied!

ResourceFormat  GetSwapChainFormat () const

Returns the swap chain resource’s format.


GetBackBufferCount

Copied!

size_t GetBackBufferCount ()

Returns the configured backbuffer count for this run.


GetBackBufferRT

Copied!

SwapChainRenderTarget * GetBackBufferRT ()

Returns the current SwapChainRenderTarget.


GetBackBufferRTV

Copied!

const ResourceViewInfo  GetBackBufferRTV () const

Returns the current back buffer’s render target view ResourceViewInfo.


GetBackBufferRTV

Copied!

const ResourceViewInfo  GetBackBufferRTV (uint8_t idx) const

Returns the specified back buffer’s render target view ResourceViewInfo.


GetBackBufferIndex

Copied!

uint8_t GetBackBufferIndex () const

Returns the current back buffer’s index.


GetSwapChainDisplayMode

Copied!

const DisplayMode GetSwapChainDisplayMode () const

Returns the swap chain’s configured DisplayMode.


GetHDRMetaData

Copied!

const HDRMetadata & GetHDRMetaData () const

Returns the swap chain’s configured HDRMetadata.


OnResize

Copied!

virtual void OnResize (uint32_t width, uint32_t height) = 0

Callback invoked while processing OnResize events.


WaitForSwapChain

Copied!

virtual void WaitForSwapChain () = 0

Waits until the last submitted swap chain has finished presenting. Only waits when we run too far ahead.


Present

Copied!

virtual void Present () = 0

Executes device presentation of the swapchain.


IsFrameInterpolation

Copied!

virtual bool IsFrameInterpolation () const

Indicates if this is a replacement frame interpolation swapchain.


GetLastPresentCount

Copied!

virtual void GetLastPresentCount (UINT* pLastPresentCount)

Gets the last present count for the swapchain.


GetRefreshRate

Copied!

virtual void GetRefreshRate (double* outRefreshRate)

Gets the current refresh rate for the swapchain.


DumpSwapChainToFile

Copied!

virtual void DumpSwapChainToFile (std::experimental::filesystem::path filePath) = 0

Creates a screenshot of the current swap chain.


CheckAndGetDisplayModeRequested

Copied!

DisplayMode CheckAndGetDisplayModeRequested (DisplayMode DispMode)

Verifies if requested display mode can be supported.


PopulateHDRMetadataBasedOnDisplayMode

Copied!

void PopulateHDRMetadataBasedOnDisplayMode ()

Prepares the HDRMetadata based on the selected display mode for the run.


SetHDRMetadataAndColorspace

Copied!

virtual void SetHDRMetadataAndColorspace () = 0

Calculates and sets HDRMetadata and color space information.


GetImpl

Copied!

virtual SwapChainInternal* GetImpl () = 0

Gets the internal implementation for api/platform parameter accessors.