Compile-time checks to ensure structs conform to WGSL's memory layout rules
The core of this crate is the [shader_layout], [shader_layout_compat] macros and the [ShaderLayout], [ShaderLayoutCompat] traits.
ShaderLayout is corresponding to https://www.w3.org/TR/WGSL/#alignment-and-size.
ShaderLayoutCompat is a subset of ShaderLayout and is corresponding to address space layout constraints of uniform without uniform_buffer_standard_layout language extension.
use ;
use ;
shader_layout!
const
shader_layout_compat!
shader_layout_compat!
const
See https://github.com/beicause/const_shader_layout/tree/master/tests for what this supports and checks.
This doesn't provide any byte conversion methods. Instead, it's intended to be used with other libraries such as bytemuck.