Returns the size, align, and unalignedSize of "the" unsized array element. Unsized arrays are only
allowed at the outer most level or the last member of a top level struct.
Example:
constcode = ` struct Foo { a: u32, b: array<vec3f>, }; @group(0) @binding(0) var<storage> f: Foo; `; constdefs = makeShaderDataDefinitions(code); const { size, align, unalignedSize } = getSizeAndAlignmentOfUnsizedArrayElement( defs.storages.f); // size = 16 (since you need to allocate 16 bytes per element) // align = 16 (since vec3f needs to be aligned to 16 bytes) // unalignedSize = 12 (since only 12 bytes are used for a vec3f)
Returns the size, align, and unalignedSize of "the" unsized array element. Unsized arrays are only allowed at the outer most level or the last member of a top level struct.
Example:
Generally you only need size. Example: