const_shader_layout 0.1.0

Compile-time checks for whether structs conform to WGSL's memory layout rules
Documentation

Compile-time checks for whether structs conform to WGSL's memory layout rules.

Build License Cargo Documentation

This provides shader_layout! macro and ShaderLayout trait. Usage:

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 is not checked yet.