Skip to content

CPU Core

Navigation: SDKHost

CPU Core

Core CPU-side defines and functions.

Functions

ffxAsUInt32

static FfxUInt32 ffxAsUInt32(FfxFloat32 x)

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

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

Parameters:

  • x (FfxFloat32) – [in] A 32bit floating value.

Returns: FfxUInt32

Attributes: static

Source: sdk/include/FidelityFX/gpu/ffx_core_cpu.h (line 57, column 20)

ffxLerp

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: (1 - t) * x + t * y

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

Parameters:

  • x (FfxFloat32) – [in] The first value to lerp between.
  • y (FfxFloat32) – [in] The second value to lerp between.
  • t (FfxFloat32) – [in] The value to determine how much of x and how much of y.

Returns: FfxFloat32

Attributes: static

Source: sdk/include/FidelityFX/gpu/ffx_core_cpu.h (line 99, column 21)

ffxReciprocal

static FfxFloat32 ffxReciprocal(FfxFloat32 x)

Compute the reciprocal of a value.

Returns: The reciprocal value of x.

Parameters:

  • x (FfxFloat32) – [in] The value to compute the reciprocal for.

Returns: FfxFloat32

Attributes: static

Source: sdk/include/FidelityFX/gpu/ffx_core_cpu.h (line 112, column 21)

ffxSqrt

static FfxFloat32 ffxSqrt(FfxFloat32 x)

Compute the square root of a value.

Returns: The the square root of x.

Parameters:

  • x (FfxFloat32) – [in] The first value to compute the min of.

Returns: FfxFloat32

Attributes: static

Source: sdk/include/FidelityFX/gpu/ffx_core_cpu.h (line 125, column 21)

ffxFract

static FfxFloat32 ffxFract(FfxFloat32 x)

Compute the factional part of a decimal value.

This function calculates x - floor(x).

Returns: The fractional part of x.

Parameters:

  • x (FfxFloat32) – [in] The value to compute the fractional part from.

Returns: FfxFloat32

Attributes: static

Source: sdk/include/FidelityFX/gpu/ffx_core_cpu.h (line 145, column 21)

ffxRsqrt

static FfxFloat32 ffxRsqrt(FfxFloat32 x)

Compute the reciprocal square root of a value.

Returns: The reciprocal square root value of x.

Parameters:

  • x (FfxFloat32) – [in] The value to compute the reciprocal for.

Returns: FfxFloat32

Attributes: static

Source: sdk/include/FidelityFX/gpu/ffx_core_cpu.h (line 158, column 21)

ffxSaturate

static FfxFloat32 ffxSaturate(FfxFloat32 x)

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

Returns: The clamped version of x.

Parameters:

  • x (FfxFloat32) – [in] The value to clamp to [0..1] range.

Returns: FfxFloat32

Attributes: static

Source: sdk/include/FidelityFX/gpu/ffx_core_cpu.h (line 191, column 21)

ffxF32ToF16

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

Returns: The closest 16bit floating point value to f.

Parameters:

  • f (FfxFloat32) – [in] The 32bit floating point value to convert.

Returns: FfxUInt32

Attributes: static

Source: sdk/include/FidelityFX/gpu/ffx_core_cpu.h (line 255, column 20)

ffxPackHalf2x16

static FfxUInt32 ffxPackHalf2x16(FfxFloat32x2 x)

Pack 2x32-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.

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

Parameters:

  • x (FfxFloat32x2) – [in] A 2-dimensional floating point value to convert and pack.

Returns: FfxUInt32

Attributes: static

Source: sdk/include/FidelityFX/gpu/ffx_core_cpu.h (line 335, column 20)