Utilities
Utilities
Utility Macros used by the FidelityFX SDK.
Defines
FFX_MAKE_VERSION
#define FFX_MAKE_VERSION(major, minor, patch) ((major <<22) | (minor <<12) | patch)
Helper macro to create the version number.
Use this to specify no version.
Source: sdk/include/FidelityFX/host/ffx_util.h
(line 45, column 9)
FFX_UNUSED
#define FFX_UNUSED(x) ((void)(x))
Helper macro to avoid warnings about unused variables.
Source: sdk/include/FidelityFX/host/ffx_util.h
(line 55, column 9)
FFX_ALIGN_UP
#define FFX_ALIGN_UP(x, y) (((x) + ((y)-1)) & ~((y)-1))
Helper macro to align an integer to the specified power of 2 boundary.
Source: sdk/include/FidelityFX/host/ffx_util.h
(line 60, column 9)
FFX_IS_ALIGNED
#define FFX_IS_ALIGNED(x) (((x) != 0) && ((x) & ((x)-1)))
Helper macro to check if a value is aligned.
Source: sdk/include/FidelityFX/host/ffx_util.h
(line 65, column 9)
FFX_DIVIDE_ROUNDING_UP
#define FFX_DIVIDE_ROUNDING_UP(x, y) ((x + y - 1) / y)
Helper macro to compute the rounded-up integer division of two unsigned integers.
Source: sdk/include/FidelityFX/host/ffx_util.h
(line 70, column 9)
FFX_STR
#define FFX_STR(s) FFX_XSTR(s)
Helper macro to stringify a value.
Source: sdk/include/FidelityFX/host/ffx_util.h
(line 75, column 9)
FFX_FORWARD_DECLARE
#define FFX_FORWARD_DECLARE(x) typedef struct x x
Helper macro to forward declare a structure.
Source: sdk/include/FidelityFX/host/ffx_util.h
(line 81, column 9)
FFX_MAXIMUM
#define FFX_MAXIMUM(x, y) (((x)> (y)) ? (x) : (y))
Helper macro to return the maximum of two values.
Source: sdk/include/FidelityFX/host/ffx_util.h
(line 86, column 9)
FFX_MINIMUM
#define FFX_MINIMUM(x, y) (((x) <(y)) ? (x) : (y))
Helper macro to return the minimum of two values.
Source: sdk/include/FidelityFX/host/ffx_util.h
(line 91, column 9)
FFX_SAFE_FREE
#define FFX_SAFE_FREE(x, freeFunc) do { \ if (x) \ { \ freeFunc(x); \ x = nullptr; \ } \ } while (false)
Helper macro to do safe free on a pointer.
Source: sdk/include/FidelityFX/host/ffx_util.h
(line 96, column 9)
FFX_ABSOLUTE
#define FFX_ABSOLUTE(x) (((x) <0) ? (-(x)) : (x))
Helper macro to return the abs of an integer value.
Source: sdk/include/FidelityFX/host/ffx_util.h
(line 108, column 9)
FFX_SIGN
#define FFX_SIGN(x) (((x) <0) ? -1 : 1)
Helper macro to return sign of a value.
Source: sdk/include/FidelityFX/host/ffx_util.h
(line 113, column 9)
FFX_ARRAY_ELEMENTS
#define FFX_ARRAY_ELEMENTS(x) (int32_t)((sizeof(x) / sizeof(0 [x])) / ((size_t)(!(sizeof(x) % sizeof(0 [x])))))
Helper macro to work out the number of elements in an array.
Source: sdk/include/FidelityFX/host/ffx_util.h
(line 118, column 9)
FFX_MAXIMUM_PATH
#define FFX_MAXIMUM_PATH (260)
The maximum length of a path that can be specified to the FidelityFX API.
Source: sdk/include/FidelityFX/host/ffx_util.h
(line 123, column 9)
FFX_CONTAINS_FLAG
#define FFX_CONTAINS_FLAG(options, key) (((options) & key) == key)
Helper macro to check if the specified key is set in a bitfield.
Source: sdk/include/FidelityFX/host/ffx_util.h
(line 128, column 9)
Functions
ffxCountBitsSet
inline uint8_t ffxCountBitsSet(uint32_t val) noexcept
Computes the number of bits set to 1 in a integer.
Returns: Number of bits set to 1 in provided val.
Parameters:
val
(uint32_t
) – [in] Integer mask.
Returns: uint8_t
Attributes: inline
Source: sdk/include/FidelityFX/host/ffx_util.h
(line 177, column 16)
Variables
const float FFX_PI
const float FFX_PI = = 3.141592653589793f
The value of Pi.
Source: sdk/include/FidelityFX/host/ffx_util.h
(line 35, column 13)
const float FFX_EPSILON
const float FFX_EPSILON = = 1e-06f
An epsilon value for floating point numbers.
Source: sdk/include/FidelityFX/host/ffx_util.h
(line 40, column 13)