diff options
author | Jason Ekstrand <[email protected]> | 2020-01-22 11:58:44 -0600 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-01-25 02:18:33 +0000 |
commit | 658dc9ca506ae9e4894c2bb1577281a356f2d817 (patch) | |
tree | 01a103179bb046f94cce4beb30e3a588b70e2d44 /src | |
parent | 64ca8a3272ec337bf026d8319b9565441c945c8b (diff) |
anv: Add another align_down helper
Reviewed-by: Lionel Landwerlin <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3519>
Diffstat (limited to 'src')
-rw-r--r-- | src/intel/vulkan/anv_private.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 2795cbda48f..6b4698d7144 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -237,10 +237,16 @@ align_u32(uint32_t v, uint32_t a) } static inline uint64_t -align_u64(uint64_t v, uint64_t a) +align_down_u64(uint64_t v, uint64_t a) { assert(a != 0 && a == (a & -a)); - return (v + a - 1) & ~(a - 1); + return v & ~(a - 1); +} + +static inline uint64_t +align_u64(uint64_t v, uint64_t a) +{ + return align_down_u64(v + a - 1, a); } static inline int32_t |