Skip to main content

impl_shader_layout_compat_array_element

Macro impl_shader_layout_compat_array_element 

Source
macro_rules! impl_shader_layout_compat_array_element {
    ($($ty:ty),+$(,)?) => { ... };
}
Expand description

Implements ShaderLayoutCompat (also implements ShaderLayout) for [T; N] for types implemented ShaderLayoutCompat.

Different from ShaderLayout, the stride of array must be a multiple of 16.

Checks at compile-time:

  • Array size must be equal to N * roundUp(16, roundUp(AlignOf(E), SizeOf(E))).

See also https://www.w3.org/TR/WGSL/#alignment-and-size and https://www.w3.org/TR/WGSL/#address-space-layout-constraints