GPU Core

GPU defines and functions.

Functions

Return type

Description

FfxFloat32

Compute the square root of a value.

FfxFloat32x2

Compute the square root of a value.

FfxFloat32x3

Compute the square root of a value.

FfxFloat32x4

Compute the square root of a value.

FfxFloat32

Compute the min of two values.

FfxFloat32x2

Compute the min of two values.

FfxFloat32x3

Compute the min of two values.

FfxFloat32x4

Compute the min of two values.

FfxInt32

Compute the min of two values.

FfxInt32x2

Compute the min of two values.

FfxInt32x3

Compute the min of two values.

FfxInt32x4

Compute the min of two values.

FfxUInt32

Compute the min of two values.

FfxUInt32x2

Compute the min of two values.

FfxUInt32x3

Compute the min of two values.

FfxUInt32x4

Compute the min of two values.

FfxFloat32

Compute the max of two values.

FfxFloat32x2

Compute the max of two values.

FfxFloat32x3

Compute the max of two values.

FfxFloat32x4

Compute the max of two values.

FfxInt32

Compute the max of two values.

FfxInt32x2

Compute the max of two values.

FfxInt32x3

Compute the max of two values.

FfxInt32x4

Compute the max of two values.

FfxUInt32

Compute the max of two values.

FfxUInt32x2

Compute the max of two values.

FfxUInt32x3

Compute the max of two values.

FfxUInt32x4

Compute the max of two values.

FfxFloat32

Compute the value of the first parameter raised to the power of the second.

FfxFloat32x2

Compute the value of the first parameter raised to the power of the second.

FfxFloat32x3

Compute the value of the first parameter raised to the power of the second.

FfxFloat32x4

Compute the value of the first parameter raised to the power of the second.

FfxFloat32

Copy the sign bit from ‘s’ to positive ‘d’.

FfxFloat32x2

Copy the sign bit from ‘s’ to positive ‘d’.

FfxFloat32x3

Copy the sign bit from ‘s’ to positive ‘d’.

FfxFloat32x4

Copy the sign bit from ‘s’ to positive ‘d’.

FfxFloat32

A single operation to return the following: m = NaN := 0 m >= 0 := 0 m < 0 := 1.

FfxFloat32x2

A single operation to return the following: m = NaN := 0 m >= 0 := 0 m < 0 := 1.

FfxFloat32x3

A single operation to return the following: m = NaN := 0 m >= 0 := 0 m < 0 := 1.

FfxFloat32x4

A single operation to return the following: m = NaN := 0 m >= 0 := 0 m < 0 := 1.

FfxFloat32

A single operation to return the following: m = NaN := 1 m > 0 := 0 m <= 0 := 1.

FfxFloat32x2

A single operation to return the following: m = NaN := 1 m > 0 := 0 m <= 0 := 1.

FfxFloat32x3

A single operation to return the following: m = NaN := 1 m > 0 := 0 m <= 0 := 1.

FfxFloat32x4

A single operation to return the following: m = NaN := 1 m > 0 := 0 m <= 0 := 1.

FfxUInt32

Convert a 32bit floating point value to sortable integer.

FfxUInt32

Convert a sortable integer to a 32bit floating point value.

FfxFloat32

Calculate a low-quality approximation for the square root of a value.

FfxFloat32

Calculate a low-quality approximation for the reciprocal of a value.

FfxFloat32

Calculate a medium-quality approximation for the reciprocal of a value.

FfxFloat32

Calculate a low-quality approximation for the reciprocal of a value.

FfxFloat32x2

Calculate a low-quality approximation for the square root of a value.

FfxFloat32x2

Calculate a low-quality approximation for the reciprocal of a value.

FfxFloat32x2

Calculate a medium-quality approximation for the reciprocal of a value.

FfxFloat32x2

Calculate a low-quality approximation for the square root of a value.

FfxFloat32x3

Calculate a low-quality approximation for the square root of a value.

FfxFloat32x3

Calculate a low-quality approximation for the reciprocal of a value.

FfxFloat32x3

Calculate a medium-quality approximation for the reciprocal of a value.

FfxFloat32x3

Calculate a low-quality approximation for the square root of a value.

FfxFloat32x4

Calculate a low-quality approximation for the square root of a value.

FfxFloat32x4

Calculate a low-quality approximation for the reciprocal of a value.

FfxFloat32x4

Calculate a medium-quality approximation for the reciprocal of a value.

FfxFloat32x4

Calculate a low-quality approximation for the square root of a value.

FfxFloat32

Calculate dot product of ‘a’ and ‘b’.

FfxFloat32

Calculate dot product of ‘a’ and ‘b’.

FfxFloat32

Calculate dot product of ‘a’ and ‘b’.

FfxFloat32

Compute an approximate conversion from PQ to Gamma2 space.

FfxFloat32

Compute an approximate conversion from PQ to linear space.

FfxFloat32

Compute an approximate conversion from gamma2 to PQ space.

FfxFloat32

Compute a more accurate approximate conversion from gamma2 to PQ space.

FfxFloat32

Compute a high accuracy approximate conversion from gamma2 to PQ space.

FfxFloat32

Compute an approximate conversion from linear to PQ space.

FfxFloat32

Compute a more accurate approximate conversion from linear to PQ space.

FfxFloat32

Compute a very accurate approximate conversion from linear to PQ space.

FfxFloat32x2

Compute an approximate conversion from PQ to Gamma2 space.

FfxFloat32x2

Compute an approximate conversion from PQ to linear space.

FfxFloat32x2

Compute an approximate conversion from gamma2 to PQ space.

FfxFloat32x2

Compute a more accurate approximate conversion from gamma2 to PQ space.

FfxFloat32x2

Compute a high accuracy approximate conversion from gamma2 to PQ space.

FfxFloat32x2

Compute an approximate conversion from linear to PQ space.

FfxFloat32x2

Compute a more accurate approximate conversion from linear to PQ space.

FfxFloat32x2

Compute a very accurate approximate conversion from linear to PQ space.

FfxFloat32x3

Compute an approximate conversion from PQ to Gamma2 space.

FfxFloat32x3

Compute an approximate conversion from PQ to linear space.

FfxFloat32x3

Compute an approximate conversion from gamma2 to PQ space.

FfxFloat32x3

Compute a more accurate approximate conversion from gamma2 to PQ space.

FfxFloat32x3

Compute a high accuracy approximate conversion from gamma2 to PQ space.

FfxFloat32x3

Compute an approximate conversion from linear to PQ space.

FfxFloat32x3

Compute a more accurate approximate conversion from linear to PQ space.

FfxFloat32x3

Compute a very accurate approximate conversion from linear to PQ space.

FfxFloat32x4

Compute an approximate conversion from PQ to Gamma2 space.

FfxFloat32x4

Compute an approximate conversion from PQ to linear space.

FfxFloat32x4

Compute an approximate conversion from gamma2 to PQ space.

FfxFloat32x4

Compute a more accurate approximate conversion from gamma2 to PQ space.

FfxFloat32x4

Compute a high accuracy approximate conversion from gamma2 to PQ space.

FfxFloat32x4

Compute an approximate conversion from linear to PQ space.

FfxFloat32x4

Compute a more accurate approximate conversion from linear to PQ space.

FfxFloat32x4

Compute a very accurate approximate conversion from linear to PQ space.

FfxUInt32

Conditional free logic AND operation using values.

FfxUInt32x2

Conditional free logic AND operation using two values.

FfxUInt32x3

Conditional free logic AND operation using two values.

FfxUInt32x4

Conditional free logic AND operation using two values.

FfxUInt32

Conditional free logic NOT operation using two values.

FfxUInt32x2

Conditional free logic NOT operation using two values.

FfxUInt32x3

Conditional free logic NOT operation using two values.

FfxUInt32x4

Conditional free logic NOT operation using two values.

FfxUInt32

Conditional free logic OR operation using two values.

FfxUInt32x2

Conditional free logic OR operation using two values.

FfxUInt32x3

Conditional free logic OR operation using two values.

FfxUInt32x4

Conditional free logic OR operation using two values.

FfxUInt32

Conditional free logic signed NOT operation using two half-precision FfxFloat32 values.

FfxUInt32x2

Conditional free logic signed NOT operation using two half-precision FfxFloat32 values.

FfxUInt32x3

Conditional free logic signed NOT operation using two half-precision FfxFloat32 values.

FfxUInt32x4

Conditional free logic signed NOT operation using two half-precision FfxFloat32 values.

FfxFloat32

Conditional free logic AND operation using two values followed by a NOT operation using the resulting value and a third value.

FfxFloat32x2

Conditional free logic AND operation using two values followed by a NOT operation using the resulting value and a third value.

FfxFloat32x3

Conditional free logic AND operation using two values followed by a NOT operation using the resulting value and a third value.

FfxFloat32x4

Conditional free logic AND operation using two values followed by a NOT operation using the resulting value and a third value.

FfxFloat32

Given a value, returns 1.0 if greater than zero and 0.0 if not.

FfxFloat32x2

Given a value, returns 1.0 if greater than zero and 0.0 if not.

FfxFloat32x3

Given a value, returns 1.0 if greater than zero and 0.0 if not.

FfxFloat32x4

Given a value, returns 1.0 if greater than zero and 0.0 if not.

FfxFloat32

Conditional free logic signed NOT operation using two FfxFloat32 values.

FfxFloat32x2

Conditional free logic signed NOT operation using two FfxFloat32 values.

FfxFloat32x3

Conditional free logic signed NOT operation using two FfxFloat32 values.

FfxFloat32x4

Conditional free logic signed NOT operation using two FfxFloat32 values.

FfxFloat32

Conditional free logic OR operation using two FfxFloat32 values.

FfxFloat32x2

Conditional free logic OR operation using two FfxFloat32 values.

FfxFloat32x3

Conditional free logic OR operation using two FfxFloat32 values.

FfxFloat32x4

Conditional free logic OR operation using two FfxFloat32 values.

FfxFloat32

Choose between two FfxFloat32 values if the first paramter is greater than zero.

FfxFloat32x2

Choose between two FfxFloat32 values if the first paramter is greater than zero.

FfxFloat32x3

Choose between two FfxFloat32 values if the first paramter is greater than zero.

FfxFloat32x4

Choose between two FfxFloat32 values if the first paramter is greater than zero.

FfxFloat32

Given a value, returns 1.0 if less than zero and 0.0 if not.

FfxFloat32x2

Given a value, returns 1.0 if less than zero and 0.0 if not.

FfxFloat32x3

Given a value, returns 1.0 if less than zero and 0.0 if not.

FfxFloat32x4

Given a value, returns 1.0 if less than zero and 0.0 if not.

FfxFloat32

Compute a Rec.709 color space.

FfxFloat32x2

Compute a Rec.709 color space.

FfxFloat32x3

Compute a Rec.709 color space.

FfxFloat32

Compute a linear value from a REC.709 value.

FfxFloat32x2

Compute a linear value from a REC.709 value.

FfxFloat32x3

Compute a linear value from a REC.709 value.

FfxFloat32

Compute a gamma value from a linear value.

FfxFloat32x2

Compute a gamma value from a linear value.

FfxFloat32x3

Compute a gamma value from a linear value.

FfxFloat32

Compute a linear value from a value in a gamma space.

FfxFloat32x2

Compute a linear value from a value in a gamma space.

FfxFloat32x3

Compute a linear value from a value in a gamma space.

FfxFloat32

Compute a PQ value from a linear value.

FfxFloat32x2

Compute a PQ value from a linear value.

FfxFloat32x3

Compute a PQ value from a linear value.

FfxFloat32

Compute a linear value from a value in a PQ space.

FfxFloat32x2

Compute a linear value from a value in a PQ space.

FfxFloat32x3

Compute a linear value from a value in a PQ space.

FfxFloat32

Compute an SRGB value from a linear value.

FfxFloat32x2

Compute an SRGB value from a linear value.

FfxFloat32x3

Compute an SRGB value from a linear value.

FfxFloat32

Compute a linear value from a value in a SRGB space.

FfxFloat32x2

Compute a linear value from a value in a SRGB space.

FfxFloat32x3

Compute a linear value from a value in a SRGB space.

FfxUInt32x2

A remapping of 64×1 to 8×8 imposing rotated 2×2 pixel quads in quad linear.

FfxUInt32x2

A helper function performing a remap 64×1 to 8×8 remapping which is necessary for 2D wave reductions.

Macros

Name

Description

FFX_FALSE (false)

A define for a false value in a boolean expression.

FFX_NEGATIVE_INFINITY_FLOAT ffxAsFloat(0xff800000u)

A define value for negative infinity.

FFX_PI (3.14159)

A define value for PI.

FFX_POSITIVE_INFINITY_FLOAT ffxAsFloat(0x7f800000u)

A define value for positive infinity.

FFX_TRUE (true)

A define for a true value in a boolean expression.

Detailed description

GPU defines and functions.

Global functions

ffxSqrt

Copied!

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.


ffxSqrt

Copied!

FfxFloat32x2  ffxSqrt (FfxFloat32x2  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.


ffxSqrt

Copied!

FfxFloat32x3  ffxSqrt (FfxFloat32x3  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.


ffxSqrt

Copied!

FfxFloat32x4  ffxSqrt (FfxFloat32x4  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.


ffxMin

Copied!

FfxFloat32  ffxMin (FfxFloat32  x, FfxFloat32  y)

Compute the min of two values.

Parameters:

x

The first value to compute the min of.

y

The second value to compute the min of.

Returns:

The the lowest of two values.


ffxMin

Copied!

FfxFloat32x2  ffxMin (FfxFloat32x2  x, FfxFloat32x2  y)

Compute the min of two values.

Parameters:

x

The first value to compute the min of.

y

The second value to compute the min of.

Returns:

The the lowest of two values.


ffxMin

Copied!

FfxFloat32x3  ffxMin (FfxFloat32x3  x, FfxFloat32x3  y)

Compute the min of two values.

Parameters:

x

The first value to compute the min of.

y

The second value to compute the min of.

Returns:

The the lowest of two values.


ffxMin

Copied!

FfxFloat32x4  ffxMin (FfxFloat32x4  x, FfxFloat32x4  y)

Compute the min of two values.

Parameters:

x

The first value to compute the min of.

y

The second value to compute the min of.

Returns:

The the lowest of two values.


ffxMin

Copied!

FfxInt32  ffxMin (FfxInt32  x, FfxInt32  y)

Compute the min of two values.

Parameters:

x

The first value to compute the min of.

y

The second value to compute the min of.

Returns:

The the lowest of two values.


ffxMin

Copied!

FfxInt32x2  ffxMin (FfxInt32x2  x, FfxInt32x2  y)

Compute the min of two values.

Parameters:

x

The first value to compute the min of.

y

The second value to compute the min of.

Returns:

The the lowest of two values.


ffxMin

Copied!

FfxInt32x3  ffxMin (FfxInt32x3  x, FfxInt32x3  y)

Compute the min of two values.

Parameters:

x

The first value to compute the min of.

y

The second value to compute the min of.

Returns:

The the lowest of two values.


ffxMin

Copied!

FfxInt32x4  ffxMin (FfxInt32x4  x, FfxInt32x4  y)

Compute the min of two values.

Parameters:

x

The first value to compute the min of.

y

The second value to compute the min of.

Returns:

The the lowest of two values.


ffxMin

Copied!

FfxUInt32  ffxMin (FfxUInt32  x, FfxUInt32  y)

Compute the min of two values.

Parameters:

x

The first value to compute the min of.

y

The second value to compute the min of.

Returns:

The the lowest of two values.


ffxMin

Copied!

FfxUInt32x2  ffxMin (FfxUInt32x2  x, FfxUInt32x2  y)

Compute the min of two values.

Parameters:

x

The first value to compute the min of.

y

The second value to compute the min of.

Returns:

The the lowest of two values.


ffxMin

Copied!

FfxUInt32x3  ffxMin (FfxUInt32x3  x, FfxUInt32x3  y)

Compute the min of two values.

Parameters:

x

The first value to compute the min of.

y

The second value to compute the min of.

Returns:

The the lowest of two values.


ffxMin

Copied!

FfxUInt32x4  ffxMin (FfxUInt32x4  x, FfxUInt32x4  y)

Compute the min of two values.

Parameters:

x

The first value to compute the min of.

y

The second value to compute the min of.

Returns:

The the lowest of two values.


ffxMax

Copied!

FfxFloat32  ffxMax (FfxFloat32  x, FfxFloat32  y)

Compute the max of two values.

Parameters:

x

The first value to compute the max of.

y

The second value to compute the max of.

Returns:

The the lowest of two values.


ffxMax

Copied!

FfxFloat32x2  ffxMax (FfxFloat32x2  x, FfxFloat32x2  y)

Compute the max of two values.

Parameters:

x

The first value to compute the max of.

y

The second value to compute the max of.

Returns:

The the lowest of two values.


ffxMax

Copied!

FfxFloat32x3  ffxMax (FfxFloat32x3  x, FfxFloat32x3  y)

Compute the max of two values.

Parameters:

x

The first value to compute the max of.

y

The second value to compute the max of.

Returns:

The the lowest of two values.


ffxMax

Copied!

FfxFloat32x4  ffxMax (FfxFloat32x4  x, FfxFloat32x4  y)

Compute the max of two values.

Parameters:

x

The first value to compute the max of.

y

The second value to compute the max of.

Returns:

The the lowest of two values.


ffxMax

Copied!

FfxInt32  ffxMax (FfxInt32  x, FfxInt32  y)

Compute the max of two values.

Parameters:

x

The first value to compute the max of.

y

The second value to compute the max of.

Returns:

The the lowest of two values.


ffxMax

Copied!

FfxInt32x2  ffxMax (FfxInt32x2  x, FfxInt32x2  y)

Compute the max of two values.

Parameters:

x

The first value to compute the max of.

y

The second value to compute the max of.

Returns:

The the lowest of two values.


ffxMax

Copied!

FfxInt32x3  ffxMax (FfxInt32x3  x, FfxInt32x3  y)

Compute the max of two values.

Parameters:

x

The first value to compute the max of.

y

The second value to compute the max of.

Returns:

The the lowest of two values.


ffxMax

Copied!

FfxInt32x4  ffxMax (FfxInt32x4  x, FfxInt32x4  y)

Compute the max of two values.

Parameters:

x

The first value to compute the max of.

y

The second value to compute the max of.

Returns:

The the lowest of two values.


ffxMax

Copied!

FfxUInt32  ffxMax (FfxUInt32  x, FfxUInt32  y)

Compute the max of two values.

Parameters:

x

The first value to compute the max of.

y

The second value to compute the max of.

Returns:

The the lowest of two values.


ffxMax

Copied!

FfxUInt32x2  ffxMax (FfxUInt32x2  x, FfxUInt32x2  y)

Compute the max of two values.

Parameters:

x

The first value to compute the max of.

y

The second value to compute the max of.

Returns:

The the lowest of two values.


ffxMax

Copied!

FfxUInt32x3  ffxMax (FfxUInt32x3  x, FfxUInt32x3  y)

Compute the max of two values.

Parameters:

x

The first value to compute the max of.

y

The second value to compute the max of.

Returns:

The the lowest of two values.


ffxMax

Copied!

FfxUInt32x4  ffxMax (FfxUInt32x4  x, FfxUInt32x4  y)

Compute the max of two values.

Parameters:

x

The first value to compute the max of.

y

The second value to compute the max of.

Returns:

The the lowest of two values.


ffxPow

Copied!

FfxFloat32  ffxPow (FfxFloat32  x, FfxFloat32  y)

Compute the value of the first parameter raised to the power of the second.

Parameters:

x

The value to raise to the power y.

y

The power to which to raise x.

Returns:

The value of the first parameter raised to the power of the second.


ffxPow

Copied!

FfxFloat32x2  ffxPow (FfxFloat32x2  x, FfxFloat32x2  y)

Compute the value of the first parameter raised to the power of the second.

Parameters:

x

The value to raise to the power y.

y

The power to which to raise x.

Returns:

The value of the first parameter raised to the power of the second.


ffxPow

Copied!

FfxFloat32x3  ffxPow (FfxFloat32x3  x, FfxFloat32x3  y)

Compute the value of the first parameter raised to the power of the second.

Parameters:

x

The value to raise to the power y.

y

The power to which to raise x.

Returns:

The value of the first parameter raised to the power of the second.


ffxPow

Copied!

FfxFloat32x4  ffxPow (FfxFloat32x4  x, FfxFloat32x4  y)

Compute the value of the first parameter raised to the power of the second.

Parameters:

x

The value to raise to the power y.

y

The power to which to raise x.

Returns:

The value of the first parameter raised to the power of the second.


ffxCopySignBit

Copied!

FfxFloat32  ffxCopySignBit (FfxFloat32  d, FfxFloat32  s)

Copy the sign bit from ‘s’ to positive ‘d’.

Parameters:

d

The value to copy the sign bit into.

s

The value to copy the sign bit from.

Returns:

The value of d with the sign bit from s.


ffxCopySignBit

Copied!

FfxFloat32x2  ffxCopySignBit (FfxFloat32x2  d, FfxFloat32x2  s)

Copy the sign bit from ‘s’ to positive ‘d’.

Parameters:

d

The value to copy the sign bit into.

s

The value to copy the sign bit from.

Returns:

The value of d with the sign bit from s.


ffxCopySignBit

Copied!

FfxFloat32x3  ffxCopySignBit (FfxFloat32x3  d, FfxFloat32x3  s)

Copy the sign bit from ‘s’ to positive ‘d’.

Parameters:

d

The value to copy the sign bit into.

s

The value to copy the sign bit from.

Returns:

The value of d with the sign bit from s.


ffxCopySignBit

Copied!

FfxFloat32x4  ffxCopySignBit (FfxFloat32x4  d, FfxFloat32x4  s)

Copy the sign bit from ‘s’ to positive ‘d’.

Parameters:

d

The value to copy the sign bit into.

s

The value to copy the sign bit from.

Returns:

The value of d with the sign bit from s.


ffxIsSigned

Copied!

FfxFloat32  ffxIsSigned (FfxFloat32  m)

A single operation to return the following: m = NaN := 0 m >= 0 := 0 m < 0 := 1.

Uses the following useful floating point logic, saturate(+a*(-INF)==-INF) := 0 saturate( 0*(-INF)== NaN) := 0 saturate(-a*(-INF)==+INF) := 1

This function is useful when creating masks for branch-free logic.

Parameters:

m

The value to test against 0.

Returns:

1.0 when the value is negative, or 0.0 when the value is 0 or position.


ffxIsSigned

Copied!

FfxFloat32x2  ffxIsSigned (FfxFloat32x2  m)

A single operation to return the following: m = NaN := 0 m >= 0 := 0 m < 0 := 1.

Uses the following useful floating point logic, saturate(+a*(-INF)==-INF) := 0 saturate( 0*(-INF)== NaN) := 0 saturate(-a*(-INF)==+INF) := 1

This function is useful when creating masks for branch-free logic.

Parameters:

m

The value to test against 0.

Returns:

1.0 when the value is negative, or 0.0 when the value is 0 or position.


ffxIsSigned

Copied!

FfxFloat32x3  ffxIsSigned (FfxFloat32x3  m)

A single operation to return the following: m = NaN := 0 m >= 0 := 0 m < 0 := 1.

Uses the following useful floating point logic, saturate(+a*(-INF)==-INF) := 0 saturate( 0*(-INF)== NaN) := 0 saturate(-a*(-INF)==+INF) := 1

This function is useful when creating masks for branch-free logic.

Parameters:

m

The value to test against 0.

Returns:

1.0 when the value is negative, or 0.0 when the value is 0 or position.


ffxIsSigned

Copied!

FfxFloat32x4  ffxIsSigned (FfxFloat32x4  m)

A single operation to return the following: m = NaN := 0 m >= 0 := 0 m < 0 := 1.

Uses the following useful floating point logic, saturate(+a*(-INF)==-INF) := 0 saturate( 0*(-INF)== NaN) := 0 saturate(-a*(-INF)==+INF) := 1

This function is useful when creating masks for branch-free logic.

Parameters:

m

The value to test against for have the sign set.

Returns:

1.0 when the value is negative, or 0.0 when the value is 0 or positive.


ffxIsGreaterThanZero

Copied!

FfxFloat32  ffxIsGreaterThanZero (FfxFloat32  m)

A single operation to return the following: m = NaN := 1 m > 0 := 0 m <= 0 := 1.

This function is useful when creating masks for branch-free logic.

Parameters:

m

The value to test against zero.

Returns:

1.0 when the value is position, or 0.0 when the value is 0 or negative.


ffxIsGreaterThanZero

Copied!

FfxFloat32x2  ffxIsGreaterThanZero (FfxFloat32x2  m)

A single operation to return the following: m = NaN := 1 m > 0 := 0 m <= 0 := 1.

This function is useful when creating masks for branch-free logic.

Parameters:

m

The value to test against zero.

Returns:

1.0 when the value is position, or 0.0 when the value is 0 or negative.


ffxIsGreaterThanZero

Copied!

FfxFloat32x3  ffxIsGreaterThanZero (FfxFloat32x3  m)

A single operation to return the following: m = NaN := 1 m > 0 := 0 m <= 0 := 1.

This function is useful when creating masks for branch-free logic.

Parameters:

m

The value to test against zero.

Returns:

1.0 when the value is position, or 0.0 when the value is 0 or negative.


ffxIsGreaterThanZero

Copied!

FfxFloat32x4  ffxIsGreaterThanZero (FfxFloat32x4  m)

A single operation to return the following: m = NaN := 1 m > 0 := 0 m <= 0 := 1.

This function is useful when creating masks for branch-free logic.

Parameters:

m

The value to test against zero.

Returns:

1.0 when the value is position, or 0.0 when the value is 0 or negative.


ffxFloatToSortableInteger

Copied!

FfxUInt32  ffxFloatToSortableInteger (FfxUInt32  value)

Convert a 32bit floating point value to sortable integer.

  • If sign bit=0, flip the sign bit (positives).

  • If sign bit=1, flip all bits (negatives).

The function has the side effects that:

  • Larger integers are more positive values.

  • Float zero is mapped to center of integers (so clear to integer zero is a nice default for atomic max usage).

Parameters:

value

The floating point value to make sortable.

Returns:

The sortable integer value.


ffxSortableIntegerToFloat

Copied!

FfxUInt32  ffxSortableIntegerToFloat (FfxUInt32  value)

Convert a sortable integer to a 32bit floating point value.

The function has the side effects that:

  • If sign bit=1, flip the sign bit (positives).

  • If sign bit=0, flip all bits (negatives).

Parameters:

value

The floating point value to make sortable.

Returns:

The sortable integer value.


ffxApproximateSqrt

Copied!

FfxFloat32  ffxApproximateSqrt (FfxFloat32  value)

Calculate a low-quality approximation for the square root of a value.

For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:

Parameters:

value

The value to calculate an approximate to the square root for.

Returns:

An approximation of the square root, estimated to low quality.


ffxApproximateReciprocal

Copied!

FfxFloat32  ffxApproximateReciprocal (FfxFloat32  value)

Calculate a low-quality approximation for the reciprocal of a value.

For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:

Parameters:

value

The value to calculate an approximate to the reciprocal for.

Returns:

An approximation of the reciprocal, estimated to low quality.


ffxApproximateReciprocalMedium

Copied!

FfxFloat32  ffxApproximateReciprocalMedium (FfxFloat32  value)

Calculate a medium-quality approximation for the reciprocal of a value.

For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:

Parameters:

value

The value to calculate an approximate to the reciprocal for.

Returns:

An approximation of the reciprocal, estimated to medium quality.


ffxApproximateReciprocalSquareRoot

Copied!

FfxFloat32  ffxApproximateReciprocalSquareRoot (FfxFloat32  value)

Calculate a low-quality approximation for the reciprocal of a value.

For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:

Parameters:

value

The value to calculate an approximate to the reciprocal square root for.

Returns:

An approximation of the reciprocal square root, estimated to low quality.


ffxApproximateSqrt

Copied!

FfxFloat32x2  ffxApproximateSqrt (FfxFloat32x2  value)

Calculate a low-quality approximation for the square root of a value.

For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:

Parameters:

value

The value to calculate an approximate to the square root for.

Returns:

An approximation of the square root, estimated to low quality.


ffxApproximateReciprocal

Copied!

FfxFloat32x2  ffxApproximateReciprocal (FfxFloat32x2  value)

Calculate a low-quality approximation for the reciprocal of a value.

For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:

Parameters:

value

The value to calculate an approximate to the reciprocal for.

Returns:

An approximation of the reciprocal, estimated to low quality.


ffxApproximateReciprocalMedium

Copied!

FfxFloat32x2  ffxApproximateReciprocalMedium (FfxFloat32x2  value)

Calculate a medium-quality approximation for the reciprocal of a value.

For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:

Parameters:

value

The value to calculate an approximate to the reciprocal for.

Returns:

An approximation of the reciprocal, estimated to medium quality.


ffxApproximateReciprocalSquareRoot

Copied!

FfxFloat32x2  ffxApproximateReciprocalSquareRoot (FfxFloat32x2  value)

Calculate a low-quality approximation for the square root of a value.

For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:

Parameters:

value

The value to calculate an approximate to the square root for.

Returns:

An approximation of the square root, estimated to low quality.


ffxApproximateSqrt

Copied!

FfxFloat32x3  ffxApproximateSqrt (FfxFloat32x3  value)

Calculate a low-quality approximation for the square root of a value.

For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:

Parameters:

value

The value to calculate an approximate to the square root for.

Returns:

An approximation of the square root, estimated to low quality.


ffxApproximateReciprocal

Copied!

FfxFloat32x3  ffxApproximateReciprocal (FfxFloat32x3  value)

Calculate a low-quality approximation for the reciprocal of a value.

For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:

Parameters:

value

The value to calculate an approximate to the reciprocal for.

Returns:

An approximation of the reciprocal, estimated to low quality.


ffxApproximateReciprocalMedium

Copied!

FfxFloat32x3  ffxApproximateReciprocalMedium (FfxFloat32x3  value)

Calculate a medium-quality approximation for the reciprocal of a value.

For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:

Parameters:

value

The value to calculate an approximate to the reciprocal for.

Returns:

An approximation of the reciprocal, estimated to medium quality.


ffxApproximateReciprocalSquareRoot

Copied!

FfxFloat32x3  ffxApproximateReciprocalSquareRoot (FfxFloat32x3  value)

Calculate a low-quality approximation for the square root of a value.

For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:

Parameters:

value

The value to calculate an approximate to the square root for.

Returns:

An approximation of the square root, estimated to low quality.


ffxApproximateSqrt

Copied!

FfxFloat32x4  ffxApproximateSqrt (FfxFloat32x4  value)

Calculate a low-quality approximation for the square root of a value.

For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:

Parameters:

value

The value to calculate an approximate to the square root for.

Returns:

An approximation of the square root, estimated to low quality.


ffxApproximateReciprocal

Copied!

FfxFloat32x4  ffxApproximateReciprocal (FfxFloat32x4  value)

Calculate a low-quality approximation for the reciprocal of a value.

For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:

Parameters:

value

The value to calculate an approximate to the reciprocal for.

Returns:

An approximation of the reciprocal, estimated to low quality.


ffxApproximateReciprocalMedium

Copied!

FfxFloat32x4  ffxApproximateReciprocalMedium (FfxFloat32x4  value)

Calculate a medium-quality approximation for the reciprocal of a value.

For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:

Parameters:

value

The value to calculate an approximate to the reciprocal for.

Returns:

An approximation of the reciprocal, estimated to medium quality.


ffxApproximateReciprocalSquareRoot

Copied!

FfxFloat32x4  ffxApproximateReciprocalSquareRoot (FfxFloat32x4  value)

Calculate a low-quality approximation for the square root of a value.

For additional information on the approximation family of functions, you can refer to Michal Drobot’s excellent presentation materials:

Parameters:

value

The value to calculate an approximate to the square root for.

Returns:

An approximation of the square root, estimated to low quality.


ffxDot2

Copied!

FfxFloat32  ffxDot2 (FfxFloat32x2  a, FfxFloat32x2  b)

Calculate dot product of ‘a’ and ‘b’.

Parameters:

a

First vector input.

b

Second vector input.

Returns:

The value of a dot b.


ffxDot3

Copied!

FfxFloat32  ffxDot3 (FfxFloat32x3  a, FfxFloat32x3  b)

Calculate dot product of ‘a’ and ‘b’.

Parameters:

a

First vector input.

b

Second vector input.

Returns:

The value of a dot b.


ffxDot4

Copied!

FfxFloat32  ffxDot4 (FfxFloat32x4  a, FfxFloat32x4  b)

Calculate dot product of ‘a’ and ‘b’.

Parameters:

a

First vector input.

b

Second vector input.

Returns:

The value of a dot b.


ffxApproximatePQToGamma2Medium

Copied!

FfxFloat32  ffxApproximatePQToGamma2Medium (FfxFloat32  a)

Compute an approximate conversion from PQ to Gamma2 space.

PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.

Parameters:

a

The value to convert between PQ and Gamma2.

Returns:

The value a converted into Gamma2.


ffxApproximatePQToLinear

Copied!

FfxFloat32  ffxApproximatePQToLinear (FfxFloat32  a)

Compute an approximate conversion from PQ to linear space.

PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.

Parameters:

a

The value to convert between PQ and linear.

Returns:

The value a converted into linear.


ffxApproximateGamma2ToPQ

Copied!

FfxFloat32  ffxApproximateGamma2ToPQ (FfxFloat32  a)

Compute an approximate conversion from gamma2 to PQ space.

PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.

Parameters:

a

The value to convert between gamma2 and PQ.

Returns:

The value a converted into PQ.


ffxApproximateGamma2ToPQMedium

Copied!

FfxFloat32  ffxApproximateGamma2ToPQMedium (FfxFloat32  a)

Compute a more accurate approximate conversion from gamma2 to PQ space.

PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.

Parameters:

a

The value to convert between gamma2 and PQ.

Returns:

The value a converted into PQ.


ffxApproximateGamma2ToPQHigh

Copied!

FfxFloat32  ffxApproximateGamma2ToPQHigh (FfxFloat32  a)

Compute a high accuracy approximate conversion from gamma2 to PQ space.

PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.

Parameters:

a

The value to convert between gamma2 and PQ.

Returns:

The value a converted into PQ.


ffxApproximateLinearToPQ

Copied!

FfxFloat32  ffxApproximateLinearToPQ (FfxFloat32  a)

Compute an approximate conversion from linear to PQ space.

PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.

Parameters:

a

The value to convert between linear and PQ.

Returns:

The value a converted into PQ.


ffxApproximateLinearToPQMedium

Copied!

FfxFloat32  ffxApproximateLinearToPQMedium (FfxFloat32  a)

Compute a more accurate approximate conversion from linear to PQ space.

PQ is very close to x^(1/8). The functions below Use the fast FfxFloat32 approximation method to do PQ conversions to and from Gamma2 (4th power and fast 4th root), and PQ to and from Linear (8th power and fast 8th root). The maximum error is approximately 0.2%.

Parameters:

a

The value to convert between linear and PQ.

Returns:

The value a converted into PQ.


ffxApproximateLinearToPQHigh