# 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)
The core of this crate is the [`shader_layout`] macro and the [`ShaderLayout`] trait.
```rust
use const_shader_layout::shader_layout;
use glam::Vec3;
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.
Note: [Uniform address space layout constraints](https://www.w3.org/TR/WGSL/#address-space-layout-constraints) is not checked yet.