diff options
Diffstat (limited to 'source/blender/blenlib/intern/math_base_inline.c')
-rw-r--r-- | source/blender/blenlib/intern/math_base_inline.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c index cfcc54b1136..9884e31f5a7 100644 --- a/source/blender/blenlib/intern/math_base_inline.c +++ b/source/blender/blenlib/intern/math_base_inline.c @@ -388,6 +388,14 @@ MINLINE uint divide_ceil_u(uint a, uint b) return (a + b - 1) / b; } +/** + * Return the next multiple of `b` after `a`. + */ +MINLINE uint ceil_multiple_u(uint a, uint b) +{ + return ((a + b - 1) / b) * b; +} + MINLINE int mod_i(int i, int n) { return (i % n + n) % n; |