
Porting Vello's GPU Tile Rasterizer to Pure Go
When you call dc.DrawCircle(400, 300, 100) in gogpu/gg , what happens under the hood? A tile-based rasterization pipeline — a direct port of Vello 's GPU compute pipeline from the linebender team — converts your vector paths into per-pixel coverage values. And it's written entirely in Pure Go. This article walks through the internals of tilecompute — a 6,700-line port of Vello's original GPU compute rasterizer (the vello_shaders/src/cpu/ pipeline, circa 2020–2023) into Pure Go. Why Not Just Use Scanline? Traditional scanline rasterizers process one row of pixels at a time. They work, but they have a fundamental scalability problem: for a 4K canvas (3840x2160), you're iterating over 8.3 million pixels regardless of how simple your shapes are. Tile-based rasterizers flip this around. They divide the canvas into small tiles (16x16 pixels in our case) and only process tiles that the vector path actually touches. A circle in the corner of a 4K canvas? You process maybe 40 tiles instead of 8
Continue reading on Dev.to
Opens in a new tab




