This PR is a total rewrite of the wgpu renderer. The prior architecture used a dedicated wgpu pipeline (which includes the shader) for every mark in the scenegraph. This proved to have a lot of overhead, making the wgpu renderer often be slower than vl-convert's resvg logic path for charts with lots of small marks.
This PR started as an experiment to create a single pipeline+shader to render the entire chart in a single render_pass. The experiment worked, and charts with lots of small marks (like https://altair-viz.github.io/gallery/scatter_matrix.html) now render over 10x faster.
I got rid of most of the dedicated renderers, except for symbol. For symbol marks with lots of instances (tens of thousands) the overhead of switching pipelines makes it worth using a dedicated pipeline with instancing.
Gradients, images, and text are support in the common renderer using textures. To unify text handling, I opted to used cosmic-text directly and drop the dependency on the glyphon fork.
With this PR, avenger-wgpu is at parity or faster on the simplest charts, and faster to much faster for complex charts and charts with large marks.
This PR is a total rewrite of the wgpu renderer. The prior architecture used a dedicated wgpu pipeline (which includes the shader) for every mark in the scenegraph. This proved to have a lot of overhead, making the wgpu renderer often be slower than vl-convert's resvg logic path for charts with lots of small marks.
This PR started as an experiment to create a single pipeline+shader to render the entire chart in a single render_pass. The experiment worked, and charts with lots of small marks (like https://altair-viz.github.io/gallery/scatter_matrix.html) now render over 10x faster.
I got rid of most of the dedicated renderers, except for symbol. For symbol marks with lots of instances (tens of thousands) the overhead of switching pipelines makes it worth using a dedicated pipeline with instancing.
Gradients, images, and text are support in the common renderer using textures. To unify text handling, I opted to used cosmic-text directly and drop the dependency on the glyphon fork.
With this PR, avenger-wgpu is at parity or faster on the simplest charts, and faster to much faster for complex charts and charts with large marks.