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.


Related pages

  • Visit the FidelityFX SDK product page for download links and more information.

Looking for more documentation on GPUOpen?

AMD GPUOpen software blogs

Our handy software release blogs will help you make good use of our tools, SDKs, and effects, as well as sharing the latest features with new releases.

GPUOpen Manuals

Don’t miss our manual documentation! And if slide decks are what you’re after, you’ll find 100+ of our finest presentations here.

AMD GPUOpen Performance Guides

The home of great performance and optimization advice for AMD RDNAâ„¢ 2 GPUs, AMD Ryzenâ„¢ CPUs, and so much more.

Getting started: AMD GPUOpen software

New or fairly new to AMD’s tools, libraries, and effects? This is the best place to get started on GPUOpen!

AMD GPUOpen Getting Started Development and Performance

Looking for tips on getting started with developing and/or optimizing your game, whether on AMD hardware or generally? We’ve got you covered!

AMD GPUOpen Technical blogs

Browse our technical blogs, and find valuable advice on developing with AMD hardware, ray tracing, Vulkan®, DirectX®, Unreal Engine, and lots more.

Find out more about our software!

AMD GPUOpen Effects - AMD FidelityFX technologies

Create wonder. No black boxes. Meet the AMD FidelityFX SDK!

AMD GPUOpen Samples

Browse all our useful samples. Perfect for when you’re needing to get started, want to integrate one of our libraries, and much more.

AMD GPUOpen developer SDKs

Discover what our SDK technologies can offer you. Query hardware or software, manage memory, create rendering applications or machine learning, and much more!

AMD GPUOpen Developer Tools

Analyze, Optimize, Profile, Benchmark. We provide you with the developer tools you need to make sure your game is the best it can be!