Skip to content

Commit

Permalink
Merge pull request #442 from rparrett/webgpu
Browse files Browse the repository at this point in the history
Allow examples to be built for WebGPU and add instructions
  • Loading branch information
StarArawn committed Dec 20, 2023
2 parents e7f5eea + 5961589 commit ce23b4c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ features = [
"bevy_winit",
"bevy_text",
"bevy_sprite",
"file_watcher",
"webgl2",
#"file_watcher",
"multi-threaded"
]

Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,21 @@ This can be made simple with [wasm-server-runner](https://github.com/jakobheller

After that's installed and configured, run:

#### WebGL2

```bash
cargo run --target wasm32-unknown-unknown --example animation --release --features atlas
cargo run --target wasm32-unknown-unknown --example animation --release --features atlas,bevy/webgl2
```

**Note**: You **must** use the `atlas` feature when targeting the web. See [#283](https://github.com/StarArawn/bevy_ecs_tilemap/issues/283).
**Note**: You **must** use the `atlas` feature when targeting the web with WebGL2. See [#283](https://github.com/StarArawn/bevy_ecs_tilemap/issues/283).

#### WebGPU

WebGPU is not yet well [supported](https://caniuse.com/webgpu) by many browsers.

```
RUSTFLAGS=--cfg=web_sys_unstable_apis cargo run --example animation --target=wasm32-unknown-unknown
```

## Bevy Compatibility

Expand Down

0 comments on commit ce23b4c

Please sign in to comment.