Skip to content

Commit

Permalink
Allow examples to be built for WebGPU and add instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
rparrett authored and ulfhermann committed Jan 28, 2024
1 parent 72e4777 commit 897797c
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 897797c

Please sign in to comment.