Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wgpu rewrite to consolidate marks into multi-mark renderer #62

Merged
merged 27 commits into from
Feb 10, 2024

Conversation

jonmmease
Copy link
Owner

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.

@jonmmease jonmmease merged commit 3917e7c into main Feb 10, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant