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
9
use const_shader_layout::shader_layout;

shader_layout! {
    //~^ ERROR: When implementing `ShaderLayout`, field `OffsetUnaligned::a4` is not properly aligned. The offset is 4 but required align is 16
    pub struct OffsetUnaligned {
        a1: f32,
        a4: glam::Vec3,
    }
}