FidelityFX Cas

FidelityFX Contrast Adaptive Sharpening runtime library.

Enumerations

Name

Description

FfxCasColorSpaceConversion

An enumeration of color space conversions used when creating a “FfxCASContext“. See “FfxCASContextDescription“.
FFX_CAS_COLOR_SPACE_LINEAR = 0 – Linear color space, will do nothing.
FFX_CAS_COLOR_SPACE_GAMMA20 = 1 – Convert gamma 2.0 to linear for input and linear to gamma 2.0 for output.
FFX_CAS_COLOR_SPACE_GAMMA22 = 2 – Convert gamma 2.2 to linear for input and linear to gamma 2.2 for output.
FFX_CAS_COLOR_SPACE_SRGB_OUTPUT = 3 – Only do sRGB conversion for output (input conversion will be done automatically).
FFX_CAS_COLOR_SPACE_SRGB_INPUT_OUTPUT = 4 – Convert sRGB to linear for input and linear to sRGB for output.

FfxCasInitializationFlagBits

An enumeration of bit flags used when creating a “FfxCASContext“. See “FfxCASContextDescription“.
FFX_CAS_SHARPEN_ONLY = (1 << 0) – A bit indicating if we sharpen only.

FfxCasPass

An enumeration of all the passes which constitute the CAS algorithm.
FFX_CAS_PASS_SHARPEN = 0 – A pass which sharpens only or upscales the color buffer.
FFX_CAS_PASS_COUNT – The number of passes performed by CAS.

Structs

Name

Description

FfxCasContext

A structure encapsulating the FidelityFX CAS context.

FfxCasContextDescription

A structure encapsulating the parameters required to initialize FidelityFX CAS.

FfxCasDispatchDescription

A structure encapsulating the parameters for dispatching the various passes of FidelityFX CAS.

Functions

Return type

Description

FFX_API FfxErrorCode

ffxCasContextCreate ( FfxCasContext * pContext, const FfxCasContextDescription * pContextDescription )
Create a FidelityFX CAS context from the parameters programmed to the “FfxCasContextDescription“ structure.

FFX_API FfxErrorCode

ffxCasContextDispatch ( FfxCasContext * pContext, const FfxCasDispatchDescription * pDispatchDescription )
..

FFX_API FfxErrorCode

Destroy the FidelityFX CAS context.

FFX_API FfxVersionNumber

Queries the effect version number.

Macros

Name

Description

FFX_CAS_CONTEXT_COUNT 1

FidelityFX CAS context count.

FFX_CAS_CONTEXT_SIZE (9206)

The size of the context specified in 32bit values.

FFX_CAS_VERSION_MAJOR (1)

Contrast Adaptive Sharpening major version.

FFX_CAS_VERSION_MINOR (2)

Contrast Adaptive Sharpening minor version.

FFX_CAS_VERSION_PATCH (0)

Contrast Adaptive Sharpening patch version.

Detailed description

FidelityFX Contrast Adaptive Sharpening runtime library.

Global functions

ffxCasContextCreate

Copied!

FFX_API  FfxErrorCode  ffxCasContextCreate (
    FfxCasContext * pContext,
    const FfxCasContextDescription * pContextDescription
)

Create a FidelityFX CAS context from the parameters programmed to the FfxCasContextDescription structure.

The context structure is the main object used to interact with the CAS, and is responsible for the management of the internal resources used by the CAS algorithm. When this API is called, multiple calls will be made via the pointers contained in the callbacks structure. These callbacks will attempt to retreive the device capabilities, , and pipelines required by CAS frame-to-frame function. Depending on configuration used when creating the FfxCasContext a different set of pipelines might be requested via the callback functions.

The FfxCasContext should be destroyed when use of it is completed, typically when an application is unloaded or CAS is disabled by a user. To destroy the CAS context you should call ffxCasContextDestroy.

Parameters:

pContext

A pointer to a FfxCasContext structure to populate.

pContextDescription

A pointer to a FfxCasContextDescription structure.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_CODE_NULL_POINTER

The operation failed because either context or contextDescription was NULL.

FFX_ERROR_INCOMPLETE_INTERFACE

The operation failed because the FfxCasContextDescription.callbacks was not fully specified.

FFX_ERROR_BACKEND_API_ERROR

The operation failed because of an error returned from the backend.


ffxCasContextDispatch

Copied!

FFX_API  FfxErrorCode  ffxCasContextDispatch (
    FfxCasContext * pContext,
    const FfxCasDispatchDescription * pDispatchDescription
)

Parameters:

pContext

A pointer to a FfxCasContext structure to populate.

pDispatchDescription

A pointer to a FfxCasDispatchDescription structure.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_CODE_NULL_POINTER

The operation failed because either context or dispatchDescription was NULL.

FFX_ERROR_BACKEND_API_ERROR

The operation failed because of an error returned from the backend.


ffxCasContextDestroy

Copied!

FFX_API  FfxErrorCode  ffxCasContextDestroy (FfxCasContext * pContext)

Destroy the FidelityFX CAS context.

Parameters:

pContext

A pointer to a FfxCasContext structure to destroy.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_CODE_NULL_POINTER

The operation failed because either context was NULL.


ffxCasGetEffectVersion

Copied!

FFX_API  FfxVersionNumber  ffxCasGetEffectVersion ()

Queries the effect version number.

Returns:

The SDK version the effect was built with.


Macros

FFX_CAS_CONTEXT_COUNT

Copied!

#define FFX_CAS_CONTEXT_COUNT 1

FidelityFX CAS context count.

Defines the number of internal effect contexts required by CAS


FFX_CAS_CONTEXT_SIZE

Copied!

#define FFX_CAS_CONTEXT_SIZE (9206)

The size of the context specified in 32bit values.


FFX_CAS_VERSION_MAJOR

Copied!

#define FFX_CAS_VERSION_MAJOR (1)

Contrast Adaptive Sharpening major version.


FFX_CAS_VERSION_MINOR

Copied!

#define FFX_CAS_VERSION_MINOR (2)

Contrast Adaptive Sharpening minor version.


FFX_CAS_VERSION_PATCH

Copied!

#define FFX_CAS_VERSION_PATCH (0)

Contrast Adaptive Sharpening patch version.


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!