3 ms·
> https://usegpu.live/docs/guides-shaders https://usegpu.live/docs/guides-shaders > Use.GPU has a powerful WGSL shader linker. It lets you compose shaders func
by nextaccountic 4y ago
> https://usegpu.live/docs/guides-shaders https://usegpu.live/docs/guides-shaders
> Use.GPU has a powerful WGSL shader linker. It lets you compose shaders functionally, with closures, using syntactically correct WGSL. It provides a real module system with per-module scope.
> The shader linker is very intentionally a stand-alone library, with no dependencies on rest of the run-time. It has minimal API surface and small size.
> Every shader is built this way. Unlike most 3D frameworks, there is no difference between built-in shaders and your own. There is no string injection or code hook system, and no privileged code in shader land. Just lots of small shader modules, used à la carte.
I see this project is written in Typescript and Rust, so.. is this shader linker written in Rust?
Could I, in principle, reuse it for running everything in Rust, with no Typescript in the frontend?
What I actually want to do: use this with https://sycamore-rs.netlify.app/ https://sycamore-rs.netlify.app/
That is,
> https://acko.net/blog/the-gpu-banana-stand/ https://acko.net/blog/the-gpu-banana-stand/
> To recap, I built a clone of the core React run-time, called Live, and used it as the basis for a set of declarative and reactive components.
Replace Live with Sycamore
- unconed 4y agoNo, the only part that's Rust is the truetype font renderer, which uses ab_glyph. But even the conversion to SDFs is in Typescript. Moving data in and out of WASM is still kind of slow, relatively speaking (until GC lands), and Rust's ergonomics are not a good fit for the API design which has a ton of optionals. The shader linker uses a Lezer grammar rather than the official WGSL tree sitter grammar so the AST node structure is more optimized for quick unconditional consumption.
- modeless 4y agoWow, you have a custom WGSL parser? Very interesting, I may have a use for this...