Module: Mesa
Branch: master
Commit: 658dc9ca506ae9e4894c2bb1577281a356f2d817
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=658dc9ca506ae9e4894c2bb1577281a356f2d817

Author: Jason Ekstrand <[email protected]>
Date:   Wed Jan 22 11:58:44 2020 -0600

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>

---

 src/intel/vulkan/anv_private.h | 10 ++++++++--
 1 file 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

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to