‹ BackHN Continuity

Thread

Testing WebGPU data layouts with Facet

90 points · 7 comments · luu

  1. scoopr · · focus · HN ↗
    Nice, always good to have some extra checking.

    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.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.