wgsl offset computer
(?)
This site is useful for understanding WGSL offsets. There's a useful runtime library for this too.
 

WGSL Offset Computer

Paste in WGSL and press "process"

Example:

 struct Light { specularFactor: f32, direction: vec3f, color: vec4f, }; @group(0) @binding(0) var<uniforms> unis: Light; 

Rather than use these offsets directly it's much more convenient to use a library.

Want learn WebGPU? See WebGPUFundamentals.org