FWIW, there's a WebGPU extension which 'harmonizes' uniform buffer struct layout with other address spaces, but currently it's only implemented in Chromium-based browsers:
Right now, I'm targeting everything (native / Firefox / Chrome / Safari), so minimizing use of extensions; this also means I get to run head-long into fun cross-platform behavior differences [1][2][3]
flohofwoe · · focus · HN ↗
Ticket: <a href="https://github.com/gpuweb/gpuweb/issues/4973" rel="nofollow">https://github.com/gpuweb/gpuweb/issues/4973
Caniuse: <a href="https://caniuse.com/?search=uniform_buffer_standard_layout" rel="nofollow">https://caniuse.com/?search=uniform_buffer_standard_layout
The std140-style layout restrictions are basically a leftover when GPUs used vec4 "register tables" for uniform data.
mkeeter · · focus · HN ↗
Right now, I'm targeting everything (native / Firefox / Chrome / Safari), so minimizing use of extensions; this also means I get to run head-long into fun cross-platform behavior differences [1][2][3]
[1] <a href="https://github.com/gfx-rs/wgpu/issues/8785" rel="nofollow">https://github.com/gfx-rs/wgpu/issues/8785
[2] <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1870699" rel="nofollow">https://bugzilla.mozilla.org/show_bug.cgi?id=1870699
[3] <a href="https://github.com/mkeeter/halfspace/issues/1#issuecomment-3593059692" rel="nofollow">https://github.com/mkeeter/halfspace/issues/1#issuecomment-3...