-
Notifications
You must be signed in to change notification settings - Fork 160
vello_hybrid: add native WebGL backend #1011
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
Merged
+2,668
−101
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6c27a0d
add vello_hybrid_shaders package and shader build step
ajakubowicz-canva 03837ef
add webg renderer backend to vello_hybrid
ajakubowicz-canva e784bf1
add examples
ajakubowicz-canva b4ec0ea
code review feedback (sans the generated code changes)
ajakubowicz-canva 782a6d8
use modules and str's for the compiled identifier mapping.
ajakubowicz-canva 25ea383
add back fmt TODO
ajakubowicz-canva 0ec25c8
code review feedback
ajakubowicz-canva File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
40 changes: 40 additions & 0 deletions
40
sparse_strips/vello_hybrid/examples/native_webgl/Cargo.toml
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[package] | ||
name = "native_webgl" | ||
version.workspace = true | ||
description = "An example showing Vello Hybrid using the WebGL2 renderer backend." | ||
edition.workspace = true | ||
license.workspace = true | ||
repository.workspace = true | ||
publish = false | ||
|
||
[lib] | ||
crate-type = ["cdylib", "rlib"] | ||
|
||
[lints] | ||
workspace = true | ||
|
||
[dependencies] | ||
console_error_panic_hook = "0.1.7" | ||
console_log = "1.0" | ||
js-sys = "0.3.77" | ||
log = { workspace = true } | ||
vello_common = { workspace = true } | ||
vello_hybrid = { workspace = true, features = ["webgl"] } | ||
vello_hybrid_scenes = { workspace = true } | ||
wasm-bindgen = "0.2.100" | ||
wasm-bindgen-futures = "0.4.50" | ||
web-sys = { version = "0.3.77", features = [ | ||
"Window", | ||
"Document", | ||
"Element", | ||
"HtmlElement", | ||
"HtmlCanvasElement", | ||
"CssStyleDeclaration", | ||
"WebGl2RenderingContext", | ||
"MouseEvent", | ||
"WheelEvent", | ||
"KeyboardEvent", | ||
] } | ||
|
||
[dev-dependencies] | ||
wasm-bindgen-test = "0.3.50" |
21 changes: 21 additions & 0 deletions
21
sparse_strips/vello_hybrid/examples/native_webgl/README.md
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
## WebGL Demo | ||
|
||
Uses Vello Hybrid with a native WebGL2 backend in the browser. This example does not use wgpu. | ||
|
||
## Development | ||
|
||
Run with `cargo run_wasm -p native_webgl --release`. | ||
|
||
## Testing | ||
|
||
In order to test this crate, you need to have [`wasm-pack`] installed. Install it using | ||
the steps found in https://rustwasm.github.io/wasm-pack/installer/. | ||
|
||
Thereafter, for interactive test sessions, run: | ||
|
||
``` | ||
wasm-pack test --chrome | ||
# Navigate to printed URL | ||
``` | ||
|
||
[`wasm-pack`]: https://rustwasm.github.io/wasm-pack/ |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.