CPU Core

Core CPU-side defines and functions.

Functions

Return type

Description

static FfxUInt32

Interpret the bit layout of an IEEE-754 floating point value as an unsigned integer.

static FfxFloat32

Compute the linear interopation between two values.

static FfxFloat32

Compute the reciprocal of a value.

static FfxFloat32

Compute the square root of a value.

static FfxFloat32

Compute the factional part of a decimal value.

static FfxFloat32

Compute the reciprocal square root of a value.

static FfxFloat32

Clamp a value to a [0..1] range.

static FfxUInt32

Convert FfxFloat32 to half (in lower 16-bits of output).

static FfxUInt32

Pack 2×32-bit floating point values in a single 32bit value.

Detailed description

Core CPU-side defines and functions.

Global functions

ffxAsUInt32

Copied!

static FfxUInt32  ffxAsUInt32 (FfxFloat32  x)

Interpret the bit layout of an IEEE-754 floating point value as an unsigned integer.

Parameters:

x

A 32bit floating value.

Returns:

An unsigned 32bit integer value containing the bit pattern of x.


ffxLerp

Copied!

static FfxFloat32  ffxLerp (FfxFloat32  x, FfxFloat32  y, FfxFloat32  t)

Compute the linear interopation between two values.

Implemented by calling the GLSL mix instrinsic function. Implements the following math:

Copied!

(1 - t) * x + t * y

Parameters:

x

The first value to lerp between.

y

The second value to lerp between.

t

The value to determine how much of x and how much of y.

Returns:

A linearly interpolated value between x and y according to t.


ffxReciprocal

Copied!

static FfxFloat32  ffxReciprocal (FfxFloat32  x)

Compute the reciprocal of a value.

Parameters:

x

The value to compute the reciprocal for.

Returns:

The reciprocal value of x.


ffxSqrt

Copied!

static FfxFloat32  ffxSqrt (FfxFloat32  x)

Compute the square root of a value.

Parameters:

x

The first value to compute the min of.

Returns:

The the square root of x.


ffxFract

Copied!

static FfxFloat32  ffxFract (FfxFloat32  x)

Compute the factional part of a decimal value.

This function calculates x - floor(x).

Parameters:

x

The value to compute the fractional part from.

Returns:

The fractional part of x.


ffxRsqrt

Copied!

static FfxFloat32  ffxRsqrt (FfxFloat32  x)

Compute the reciprocal square root of a value.

Parameters:

x

The value to compute the reciprocal for.

Returns:

The reciprocal square root value of x.


ffxSaturate

Copied!

static FfxFloat32  ffxSaturate (FfxFloat32  x)

Clamp a value to a [0..1] range.

Parameters:

x

The value to clamp to [0..1] range.

Returns:

The clamped version of x.


ffxF32ToF16

Copied!

static FfxUInt32  ffxF32ToF16 (FfxFloat32  f)

Convert FfxFloat32 to half (in lower 16-bits of output).

This function implements the same fast technique that is documented here: ftp://ftp.fox-toolkit.org/pub/fasthalffloatconversion.pdf

The function supports denormals.

Some conversion rules are to make computations possibly “safer” on the GPU, -INF & -NaN -> -65504 +INF & +NaN -> +65504

Parameters:

f

The 32bit floating point value to convert.

Returns:

The closest 16bit floating point value to f.


ffxPackHalf2x16

Copied!

static FfxUInt32  ffxPackHalf2x16 (FfxFloat32x2  x)

Pack 2×32-bit floating point values in a single 32bit value.

This function first converts each component of value into their nearest 16-bit floating point representation, and then stores the X and Y components in the lower and upper 16 bits of the 32bit unsigned integer respectively.

Parameters:

x

A 2-dimensional floating point value to convert and pack.

Returns:

A packed 32bit value containing 2 16bit floating point values.


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!