summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-07-15 11:50:20 -0700
committerJason Ekstrand <[email protected]>2016-07-15 15:48:21 -0700
commit827405f07259424ca716dcb217ef0a813ad67963 (patch)
treee1bc820ff01b5a2c143074a49e54dfdb27eedf03
parentf124f4a394680f8a1847339770c8d245282bbe01 (diff)
anv: Add an align_down_npot_u32 helper
Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
-rw-r--r--src/intel/vulkan/anv_private.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 4730641eaf2..d8a9d8782fe 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));