back

by raphlinus·3y ago·view on hn ↗
I'm very happy to see this work! The era of rendering vector graphics in GPU compute shaders is upon us, and I have no doubt it we'll start seeing these in production soon, as there's just such a performance advantage over CPU rendering, and I believe trying to run vector 2D graphics through the GPU rasterization pipeline doesn't quite work.

This code is simpler than Vello (the new name for piet-gpu), focused on vector path rendering. It's also a strong demo of the power of WebGPU, while also having a performant software-only pipeline. I definitely encourage people to take a closer look.

4 comments
> I believe trying to run vector 2D graphics through the GPU rasterization pipeline doesn't quite work.

I mean, it does work, it's just slower than using compute in most cases. I mean, people have emulated Linux in the GPU rasterization pipeline [1], so the raster pipeline is clearly Turing complete :)

[1]: https://blog.pimaker.at/texts/rvc1/

Thank you for the endorsement. Looking forward to collaborating more with you on 2D graphics.
How does this compare to https://github.com/RazrFalcon/resvg ?
That's a different kind of thing, I think. It renders using tiny-skia, so probably comparing to tiny-skia would be more appropriate? It also sounds like resvg's renderer can be swapped out, so it may be possible to have it render with Forma.
I just tried it in my own renderer (that uses tiny-skia) to compare performance, but unfortunately forma is still lacking some features to do a proper comparison (strokes, the ability to scale shapes up instead of only down (?????), rendering without clearing).
That sounds neat.
I saw google, I saw Rust, and I was betting it was you. I lost my bet but still happy to see it!
Haven't Skia et al been GPU accelerated for ages?
Yes, Skia uses the traditional method of tessellating path geometry on the CPU and then having the GPU handle transforming and shading it as if it were 3D geometry. Compare that with what we see here, which uses compute shaders for the whole process.