const_shader_layout 0.3.3

Compile-time checks to ensure 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: Failed to implement `ShaderLayout`: field `OffsetUnaligned::a4` (`glam::Vec3`) is not properly aligned. The offset is 4 but required align is 16
    pub struct OffsetUnaligned {
        a1: f32,
        a4: glam::Vec3,
    }
}