-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
remove gradient and dedicated circle support
This is now just as fast as instanced renderer, so remove instanced rect renderer
Remove text renderer and dependency on glyphon fork
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.