Module ash::util [] [src]

Structs

Align

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 Vec3, get_buffer_memory_requirements might return an alignment of 16 bytes. A Vec3 has a size of 12 bytes. The memory layout for a Vec<Vec3<f32>> will be contigous, because 4 is a multiple of 12. But Vulkan expects a 4 byte padding in between each Vec3, if the alignment is 16 bytes. Vec3<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.

AlignIter