summaryrefslogtreecommitdiffstats
path: root/src/vulkan/anv_private.h
diff options
context:
space:
mode:
authorJordan Justen <[email protected]>2016-01-06 15:40:01 -0800
committerJordan Justen <[email protected]>2016-01-07 10:37:35 -0800
commit4d68c477ad29bc39794eb5f3e5f0886129c6c9c5 (patch)
treef1932b9975dcc4b7e3761794f924d7ad898f0dc3 /src/vulkan/anv_private.h
parentbe91f23e3b9381711c21978001862a6edb0bb2fd (diff)
anv: Assert that alignments are not 0 for align_*
Signed-off-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/vulkan/anv_private.h')
-rw-r--r--src/vulkan/anv_private.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vulkan/anv_private.h b/src/vulkan/anv_private.h
index 5bd50258c8a..0cd8ab6facd 100644
--- a/src/vulkan/anv_private.h
+++ b/src/vulkan/anv_private.h
@@ -83,18 +83,21 @@ typedef union _VK_LOADER_DATA {
static inline uint32_t
align_u32(uint32_t v, uint32_t a)
{
+ assert(a != 0 && a == (a & -a));
return (v + a - 1) & ~(a - 1);
}
static inline uint64_t
align_u64(uint64_t v, uint64_t a)
{
+ assert(a != 0 && a == (a & -a));
return (v + a - 1) & ~(a - 1);
}
static inline int32_t
align_i32(int32_t v, int32_t a)
{
+ assert(a != 0 && a == (a & -a));
return (v + a - 1) & ~(a - 1);
}