1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Utility math functions.
/// Trait for adjusting integers to the next multiple of an alignment.
impl_align_to!;
impl_align_to!;
impl_align_to!;
/// Aligns a `value` to an `alignment`.
///
/// Returns the first number greater than or equal to `value` that is also a
/// multiple of `alignment`. If `value` is already a multiple of `alignment`,
/// `value` will be returned.
///
/// # Panics
///
/// If aligning `value` to `alignment` would overflow.
///
/// # Examples
///
/// ```
/// # use wgpu_types::math::align_to;
/// assert_eq!(align_to(253_u32, 16), 256);
/// assert_eq!(align_to(256_u32, 16), 256);
/// assert_eq!(align_to(0_u32, 16), 0);
/// ```
///