Skip to content

Commit

Permalink
Merge pull request #2068 from iced-rs/webgpu-by-default
Browse files Browse the repository at this point in the history
Enable WebGPU backend in `wgpu` by default instead of WebGL
  • Loading branch information
hecrj authored Sep 4, 2023
2 parents 2c51e34 + 685e445 commit a56b25b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
web:
runs-on: ubuntu-latest
env:
RUSTFLAGS: --cfg=web_sys_unstable_apis
steps:
- uses: hecrj/setup-rust-action@v1
with:
Expand Down
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ palette = ["iced_core/palette"]
system = ["iced_winit/system"]
# Enables broken "sRGB linear" blending to reproduce color management of the Web
web-colors = ["iced_renderer/web-colors"]
# Enables the WebGL backend, replacing WebGPU
webgl = ["iced_renderer/webgl"]
# Enables the advanced module
advanced = []

Expand Down
1 change: 1 addition & 0 deletions renderer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ svg = ["iced_tiny_skia/svg", "iced_wgpu?/svg"]
geometry = ["iced_graphics/geometry", "iced_tiny_skia/geometry", "iced_wgpu?/geometry"]
tracing = ["iced_wgpu?/tracing"]
web-colors = ["iced_wgpu?/web-colors"]
webgl = ["iced_wgpu?/webgl"]

[dependencies]
raw-window-handle = "0.5"
Expand Down
4 changes: 1 addition & 3 deletions wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ geometry = ["iced_graphics/geometry", "lyon"]
image = ["iced_graphics/image"]
svg = ["resvg"]
web-colors = ["iced_graphics/web-colors"]
webgl = ["wgpu/webgl"]

[dependencies]
wgpu = "0.17"
Expand All @@ -24,9 +25,6 @@ once_cell = "1.0"
rustc-hash = "1.1"
log = "0.4"

[target.'cfg(target_arch = "wasm32")'.dependencies]
wgpu = { version = "0.17", features = ["webgl"] }

[dependencies.twox-hash]
version = "1.6"
default-features = false
Expand Down

0 comments on commit a56b25b

Please sign in to comment.