diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed2b396178..5945a99e5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -142,8 +142,6 @@ jobs: target: wasm32-unknown-unknown - name: Check wasm run: cargo check --target wasm32-unknown-unknown - env: - RUSTFLAGS: --cfg=web_sys_unstable_apis markdownlint: runs-on: ubuntu-latest diff --git a/Cargo.toml b/Cargo.toml index 0a41a17a93..ccafda0358 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -289,7 +289,7 @@ pbr_transmission_textures = ["bevy_internal/pbr_transmission_textures"] # Enable some limitations to be able to use WebGL2. Please refer to the [WebGL2 and WebGPU](https://github.com/bevyengine/bevy/tree/latest/examples#webgl2-and-webgpu) section of the examples README for more information on how to run Wasm builds with WebGPU. webgl2 = ["bevy_internal/webgl"] -# Enable support for WebGPU in Wasm. When enabled, this feature will override the `webgl2` feature and you won't be able to run Wasm builds with WebGL2, only with WebGPU. Requires the `RUSTFLAGS` environment variable to be set to `--cfg=web_sys_unstable_apis` when building. +# Enable support for WebGPU in Wasm. When enabled, this feature will override the `webgl2` feature and you won't be able to run Wasm builds with WebGL2, only with WebGPU. webgpu = ["bevy_internal/webgpu"] # Enables the built-in asset processor for processed assets. diff --git a/crates/bevy_render/Cargo.toml b/crates/bevy_render/Cargo.toml index c1bb39ba5b..3e512a663b 100644 --- a/crates/bevy_render/Cargo.toml +++ b/crates/bevy_render/Cargo.toml @@ -64,7 +64,7 @@ image = { version = "0.24", default-features = false } codespan-reporting = "0.11.0" # `fragile-send-sync-non-atomic-wasm` feature means we can't use WASM threads for rendering # It is enabled for now to avoid having to do a significant overhaul of the renderer just for wasm -wgpu = { version = "0.19.1", default-features = false, features = [ +wgpu = { version = "0.19.3", default-features = false, features = [ "wgsl", "dx12", "metal", @@ -105,9 +105,7 @@ naga_oil = { version = "0.13", default-features = false, features = [ [target.'cfg(target_arch = "wasm32")'.dependencies] naga_oil = "0.13" js-sys = "0.3" -# web-sys doesn't follow semver for the WebGPU APIs as they are unstable -# Make sure that WebGPU builds work when changing this! -web-sys = { version = "=0.3.67", features = [ +web-sys = { version = "0.3.67", features = [ 'Blob', 'Document', 'Element', diff --git a/docs-template/EXAMPLE_README.md.tpl b/docs-template/EXAMPLE_README.md.tpl index dae5944856..697637ac9f 100644 --- a/docs-template/EXAMPLE_README.md.tpl +++ b/docs-template/EXAMPLE_README.md.tpl @@ -239,13 +239,6 @@ ruby -run -ehttpd examples/wasm Bevy support for WebGPU is being worked on, but is currently experimental. To build for WebGPU, you'll need to enable the `webgpu` feature. This will override the `webgl2` feature, and builds with the `webgpu` feature enabled won't be able to run on browsers that don't support WebGPU. -WebGPU depends on unstable APIs so you will also need to pass the `web_sys_unstable_apis` flag to your builds. For example: - -```sh -RUSTFLAGS=--cfg=web_sys_unstable_apis cargo build ... -``` - -Check `wasm-bindgen` [docs on Unstable APIs](https://rustwasm.github.io/wasm-bindgen/web-sys/unstable-apis.html) for more details. Bevy has an helper to build its examples: diff --git a/docs/cargo_features.md b/docs/cargo_features.md index c3dfba74fe..48f000f5ca 100644 --- a/docs/cargo_features.md +++ b/docs/cargo_features.md @@ -81,7 +81,7 @@ The default feature set enables most of the expected features of a game engine, |trace_tracy_memory|Tracing support, with memory profiling, exposing a port for Tracy| |wav|WAV audio format support| |wayland|Wayland display server support| -|webgpu|Enable support for WebGPU in Wasm. When enabled, this feature will override the `webgl2` feature and you won't be able to run Wasm builds with WebGL2, only with WebGPU. Requires the `RUSTFLAGS` environment variable to be set to `--cfg=web_sys_unstable_apis` when building.| +|webgpu|Enable support for WebGPU in Wasm. When enabled, this feature will override the `webgl2` feature and you won't be able to run Wasm builds with WebGL2, only with WebGPU.| |webp|WebP image format support| |wgpu_trace|Save a trace of all wgpu calls| |zlib|For KTX2 supercompression| diff --git a/examples/README.md b/examples/README.md index 0a2b9503c6..ae013b92bb 100644 --- a/examples/README.md +++ b/examples/README.md @@ -576,13 +576,6 @@ ruby -run -ehttpd examples/wasm Bevy support for WebGPU is being worked on, but is currently experimental. To build for WebGPU, you'll need to enable the `webgpu` feature. This will override the `webgl2` feature, and builds with the `webgpu` feature enabled won't be able to run on browsers that don't support WebGPU. -WebGPU depends on unstable APIs so you will also need to pass the `web_sys_unstable_apis` flag to your builds. For example: - -```sh -RUSTFLAGS=--cfg=web_sys_unstable_apis cargo build ... -``` - -Check `wasm-bindgen` [docs on Unstable APIs](https://rustwasm.github.io/wasm-bindgen/web-sys/unstable-apis.html) for more details. Bevy has an helper to build its examples: diff --git a/tools/build-wasm-example/src/main.rs b/tools/build-wasm-example/src/main.rs index 351439a4ff..dbf01004ff 100644 --- a/tools/build-wasm-example/src/main.rs +++ b/tools/build-wasm-example/src/main.rs @@ -71,13 +71,10 @@ fn main() { parameters.push("--features"); parameters.push(&features_string); } - let mut cmd = cmd!( + let cmd = cmd!( sh, "cargo build {parameters...} --profile release --target wasm32-unknown-unknown --example {example}" ); - if matches!(cli.api, WebApi::Webgpu) { - cmd = cmd.env("RUSTFLAGS", "--cfg=web_sys_unstable_apis"); - } cmd.run().expect("Error building example"); cmd!(