# Compile-time checks for whether structs conform to WGSL's [memory layout rules](https://www.w3.org/TR/WGSL/#alignment-and-size).
[](https://github.com/beicause/const_shader_layout/actions)
[](https://github.com/beicause/const_shader_layout)
[](https://crates.io/crates/const_shader_layout)
[](https://docs.rs/const_shader_layout)
This provides `shader_layout!` macro and `ShaderLayout` trait. Usage:
```rust
shader_layout! {
pub struct MyUniform {
a1: f32,
a2: [f32; 2],
a3: [f32; 1],
a4: Vec3,
a5: f32
}
}
```
See <https://github.com/beicause/const_shader_layout/tree/master/tests> for what this supports and checks.
[Uniform address space layout constraints](https://www.w3.org/TR/WGSL/#address-space-layout-constraints) is not checked yet.