Struct ash::util::Align
[−]
[src]
pub struct Align<T> { /* fields omitted */ }
Align
handles dynamic alignment. x86 aligns on 4 byte boundries but GPUs
sometimes have different requirements. For example if the user wants to create
a Uniform buffer of a Vec3get_buffer_memory_requirements
might return
an alignment of 16 bytes. A Vec3Vec<Vec3<f32>>
will be contigous, because 4 is a multiple of 12. But Vulkan
expects a 4 byte padding in between each Vec3Vec3<f32>, 4bytes, Vec3<f32>, 4bytes, Vec3<f32>...
. Align is able to take a slice
that is allocated on 4 bytes boundries, and insert the correct amount of paddings.