Testing WebGPU data layouts with Facet
Thread
Loading the complete thread in the background. This saved snapshot is available now. Refresh
Unofficial Hacker News client; not affiliated with Y Combinator.
Testing WebGPU data layouts with Facet
Loading the complete thread in the background. This saved snapshot is available now. Refresh
Unofficial Hacker News client; not affiliated with Y Combinator.
brinepot · · focus · HN ↗
jauntywundrkind · · focus · HN ↗
It's great having tools like Facet around to add runtime type information in. I wish TypeScript was seeing progress but there's seemingly no progress or traction in 5 years+, just some early experiments which died out.
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...
77rushi77 · · focus · HN ↗
[dead]
genxy · · focus · HN ↗
<a href="https://github.com/facet-rs/facet" rel="nofollow">https://github.com/facet-rs/facet
> The core crates give types a SHAPE associated constant with their kind, layout, fields, documentation, attributes, and type-specific operations. facet-reflect builds, reads, and mutates values through those shapes while preserving their invariants.
> Serialization and integration crates build on that reflection layer: JSON, TOML, YAML, MessagePack, Postcard, ASN.1, XDR, CSV, XML, URL-encoded forms, SQLite, Axum, schema generation, structural diffing, and more.
Side by side comparison with SERDE <a href="https://facet.rs/guide/serde/" rel="nofollow">https://facet.rs/guide/serde/
scoopr · · focus · HN ↗
While most of the time you want the memcpy semantics, but I wonder if naga could be used to compute a facet SHAPE from the shader. Maybe it could be used to "serialise" the cpu format to gpu format, without them needing to be padding/repr-compatible (or even field-reorder-compatible!).
Another option of course would be to parse the struct with naga and just always generate the rust counterpart, then it should always be compatible and up-to-date, but then you have codegen in your build step.
flipflowdev · · focus · HN ↗
[dead]
xyzsparetimexyz · · focus · HN ↗