util: Getting util_align_npot to be same with ALIGN_NPOT so it can be merged latter
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

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:
Yonggang Luo 2025-11-14 01:06:45 +08:00
parent 07d059f3e2
commit 54715e8989

View file

@ -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