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
10
//@check-pass
use const_shader_layout::shader_layout_compat;

// Succeeds because `f32` is aligned in `repr(C)`.
shader_layout_compat! {
    pub struct AlignF16 {
        a4: half::f16,
        a1: f32,
    }
}