diff options
author | Jacques Lucke <mail@jlucke.com> | 2019-07-29 18:53:12 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2019-07-29 18:53:12 +0300 |
commit | 910431e3826083b914ed5949de6170fa533ccacc (patch) | |
tree | 0afbaa9f68e5d522465ac25b2ce55de11704dda1 /source/blender/blenlib/intern/math_base_inline.c | |
parent | bd514d20e0ac9fa6530fa08f5e9505156b576d18 (diff) |
start taking alignment of types into account when constructing tuples
Diffstat (limited to 'source/blender/blenlib/intern/math_base_inline.c')
-rw-r--r-- | source/blender/blenlib/intern/math_base_inline.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c index 8f30255a08b..1b3689a8a71 100644 --- a/source/blender/blenlib/intern/math_base_inline.c +++ b/source/blender/blenlib/intern/math_base_inline.c @@ -225,6 +225,12 @@ MINLINE unsigned power_of_2_min_u(unsigned x) return x - (x >> 1); } +MINLINE unsigned int pad_up(unsigned int x, unsigned int alignment) +{ + BLI_assert(is_power_of_2_i((int)alignment)); + return (x + alignment - 1) & ~(alignment - 1); +} + /* rounding and clamping */ #define _round_clamp_fl_impl(arg, ty, min, max) \ |