mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 15:20:17 +01:00
util: Getting util_align_npot to be same with ALIGN_NPOT so it can be merged latter
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38431>
This commit is contained in:
parent
07d059f3e2
commit
54715e8989
1 changed files with 2 additions and 3 deletions
|
|
@ -707,9 +707,8 @@ align_uintptr(uintptr_t value, uintptr_t alignment)
|
|||
static inline size_t
|
||||
util_align_npot(size_t value, size_t alignment)
|
||||
{
|
||||
if (value % alignment)
|
||||
return value + (alignment - (value % alignment));
|
||||
return value;
|
||||
assert(alignment > 0);
|
||||
return (value + alignment - 1) / alignment * alignment;
|
||||
}
|
||||
|
||||
static inline size_t
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue