Skip to content

LiteFX::Math::alignPoT

Aligns a value size to an alignment alignment that is a power of two.

Synopsis

Declared in <litefx/math.hpp>

template<std::integral T = UInt32>
constexpr static T alignPoT(
    T size,
    T alignment);

Return Value

The aligned value.

Template Parameters

NameDescription
TThe type of the value to align.

Parameters

NameDescription
sizeThe value to align.
alignmentThe alignment to align the value to. Must be a power of two.