Skip to content

fix(with_winit): enable wgpu backends so web demo loads - #81

Open
matthargett wants to merge 1 commit into
linebender:mainfrom
rebeckerspecialties:fix/with-winit-wgpu-backends
Open

fix(with_winit): enable wgpu backends so web demo loads#81
matthargett wants to merge 1 commit into
linebender:mainfrom
rebeckerspecialties:fix/with-winit-wgpu-backends

Conversation

@matthargett

Copy link
Copy Markdown

Summary

  • The hosted with_winit web demo has been crashing on startup in every browser (Firefox, Chrome, Safari) with RuntimeError: unreachable inside wgpu::Instance::new, leaving a blank page.
  • Root cause: the workspace declares vello = { ..., default-features = false } (since vello_svg itself doesn't need wgpu), which drops vello's wgpu_default feature. The with_winit example only re-enabled vello's bare wgpu feature, so wgpu was compiled with no backends — and on wasm32 its Instance::new panics with "No wgpu backend feature that is implemented for the target platform was enabled."
  • Fix: enable vello's wgpu_default feature (instead of wgpu) for the with_winit example on all targets, so the webgpu backend (and the native backends) are actually compiled in.

Verified locally with cargo build -p with_winit --bin with_winit_bin --target wasm32-unknown-unknown. cargo tree -p wgpu --target wasm32-unknown-unknown now shows wgpu features include webgpu, where previously none of the backend features were enabled.

Fixes #80

Test plan

The workspace pulls in `vello` with `default-features = false` (since
`vello_svg` itself doesn't need `wgpu`), which drops vello's
`wgpu_default` feature. The `with_winit` example only enabled vello's
bare `wgpu` feature, so `wgpu` was compiled with no backends and
`wgpu::Instance::new` panicked at startup with "No wgpu backend feature
that is implemented for the target platform was enabled." — producing a
blank page in every browser.

Enable `wgpu_default` for the `with_winit` example on all targets so the
`webgpu` backend (and native backends) are compiled in.

Fixes linebender#80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linebender.org/vello_svg hard-errors on all major browsers

1 participant