diff options
Diffstat (limited to 'src/mesa/main/macros.h')
-rw-r--r-- | src/mesa/main/macros.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index 05aad4eb8b1..4bb17d8d174 100644 --- a/src/mesa/main/macros.h +++ b/src/mesa/main/macros.h @@ -675,6 +675,18 @@ minify(unsigned value, unsigned levels) */ #define ALIGN(value, alignment) (((value) + (alignment) - 1) & ~((alignment) - 1)) +/** + * Align a value down to an alignment value + * + * If \c value is not already aligned to the requested alignment value, it + * will be rounded down. + * + * \param value Value to be rounded + * \param alignment Alignment value to be used. This must be a power of two. + * + * \sa ALIGN() + */ +#define ROUND_DOWN_TO(value, alignment) ((value) & ~(alignment - 1)) /** Cross product of two 3-element vectors */ |