# WGSL Uniform Buffer Alignment When creating uniform buffers for WGSL shaders, struct fields must be aligned: | Type | Alignment | |------|-----------| | `f32` | 4 bytes | | `vec2` | 8 bytes | | `vec3` | 16 bytes (treated as vec4) | | `vec4` | 16 bytes | | `mat4x4` | 16 bytes (64 bytes total) | Use padding fields to match WGSL struct layout exactly. Prefer `vec4` over individual floats to avoid alignment issues. Shaders live in `src/shaders/` and are embedded via `include_str!()`.