const_shader_layout 0.3.0

Compile-time checks for whether structs conform to WGSL's memory layout rules
Documentation
1
2
3
4
5
6
7
8
use const_shader_layout::shader_layout;

shader_layout! {
    //~^ ERROR: When implementing `ShaderLayout`, struct `SizeUnaligned` size (12) must be equal to its shader size (16), i.e. `roundUp(AlignOf(S), SizeOf(S)))`
    pub struct SizeUnaligned {
        a4: glam::Vec3,
    }
}