-
Notifications
You must be signed in to change notification settings - Fork 164
[vello_cpu]: add WASM vello_cpu examples #1076
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've played around with and encountered no issues, it seems to work fine, thanks! I've only skimmed the actual code and not thought about it deeply, but since most of it is ported from existing code, it should be fine!
Yeah - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I think once we have our rendering abstraction we can consider combining these examples
6f407ce
to
5309be3
Compare
### Context To help with performance profiling and inspecting vello_cpu example renders on the browser, this PR adds a vello_cpu examples. Run with `cargo run_wasm -p wasm_cpu --release` ### Scenes added We don't yet have a rendering abstraction between `vello_cpu` and `vello_hybrid`, so the example scenes are pretty similar, but not quite identical. I simplified each one to use `RenderContext` instead of `Scene`, and also made them very specific to running on the browser. I added: - simple - tiger svg - cowboy image - text - clipping No new assets are added in this PR - only existing assets in the repo are used. See the screen recording to see the scenes added. ### Test plan > [!Note] > Passing the +simd128 rustc flags spams the console with `(ignoring feature)` logs. This is because the run-wasm tool is built for your system architecture with the same global flags – and because it's not wasm it doesn't recognize the feature. Everything still works. Test it by running it with `cargo run_wasm -p wasm_cpu --release` and test explicit SIMD by running `RUSTFLAGS=-Ctarget-feature=+simd128 cargo run_wasm -p wasm_cpu --release`. ### Screen recording https://github.com/user-attachments/assets/80867362-bce5-4a9e-b303-88b2c9233972 (cherry picked from commit e7a75ec)
Context
To help with performance profiling and inspecting vello_cpu example renders on the browser, this PR adds a vello_cpu examples.
Run with
cargo run_wasm -p wasm_cpu --release
Scenes added
We don't yet have a rendering abstraction between
vello_cpu
andvello_hybrid
, so the example scenes are pretty similar, but not quite identical. I simplified each one to useRenderContext
instead ofScene
, and also made them very specific to running on the browser.I added:
No new assets are added in this PR - only existing assets in the repo are used. See the screen recording to see the scenes added.
Test plan
Note
Passing the +simd128 rustc flags spams the console with
(ignoring feature)
logs. This is because the run-wasm tool is built for your system architecture with the same global flags – and because it's not wasm it doesn't recognize the feature. Everything still works.Test it by running it with
cargo run_wasm -p wasm_cpu --release
and test explicit SIMD by runningRUSTFLAGS=-Ctarget-feature=+simd128 cargo run_wasm -p wasm_cpu --release
.Screen recording
output.mp4