Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <mail@jlucke.com>2019-07-29 18:53:12 +0300
committerJacques Lucke <mail@jlucke.com>2019-07-29 18:53:12 +0300
commit910431e3826083b914ed5949de6170fa533ccacc (patch)
tree0afbaa9f68e5d522465ac25b2ce55de11704dda1 /source/blender/blenlib/intern/math_base_inline.c
parentbd514d20e0ac9fa6530fa08f5e9505156b576d18 (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.c6
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) \