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_compat;

shader_layout_compat! {
    pub struct S1 {
        a1: [f32; 1],
        //~^ ERROR: the trait bound `[f32; 1]: ShaderLayoutCompat` is not satisfied
    }
}