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 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.

Methods

impl<T: Copy> Align<T>
[src]

[src]

impl<T> Align<T>
[src]

[src]

[src]

Trait Implementations

impl<T: Debug> Debug for Align<T>
[src]

[src]

Formats the value using the given formatter.

impl<T: Clone> Clone for Align<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more