audulus/vger

GPU path "scanning"

Closed this issue · 2 comments

Currently to render path fills efficiently, vger "scans" the path (see vgerPathScanner) and divides it into horizontal slabs on the CPU. This is the most significant CPU expense for rendering SVGs.

Another option would be to generate this acceleration information on the GPU. A thread group would process a single path and compute a grid, where each square (or tile) contains a list of the relevant segment indices.

In the current CPU implementation, a detailed path can have many slabs:

image

This is challenging for the GPU since each path would need handling at a different resolution.

image

In the above case (topographical level of Hawaii), much of the time is spent in sdPrim.

Not going to attempt this.