Mesa (master): anv: Add an align_down_npot_u32 helper

Jason Ekstrand jekstrand at kemper.freedesktop.org
Fri Jul 15 22:48:56 UTC 2016


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

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Fri Jul 15 11:50:20 2016 -0700

anv: Add an align_down_npot_u32 helper

Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
Cc: "12.0" <mesa-stable at lists.freedesktop.org>

---

 src/intel/vulkan/anv_private.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 4730641..d8a9d87 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -83,6 +83,12 @@ extern "C" {
 #define MAX(a, b) ((a) > (b) ? (a) : (b))
 
 static inline uint32_t
+align_down_npot_u32(uint32_t v, uint32_t a)
+{
+   return v - (v % a);
+}
+
+static inline uint32_t
 align_u32(uint32_t v, uint32_t a)
 {
    assert(a != 0 && a == (a & -a));




More information about the mesa-commit mailing list