Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

egui-wgpu missing wgpu webgpu feature #4123

Closed
ctaggart opened this issue Mar 2, 2024 · 0 comments · Fixed by #4124
Closed

egui-wgpu missing wgpu webgpu feature #4123

ctaggart opened this issue Mar 2, 2024 · 0 comments · Fixed by #4124
Labels
bug Something is broken

Comments

@ctaggart
Copy link
Contributor

ctaggart commented Mar 2, 2024

I'm targeting wasm32 and when upgrading the eframe 0.26, it does not compile.

The .cargo/config

[build]
target = "wasm32-unknown-unknown"
rustflags = "--cfg=web_sys_unstable_apis"

From Cargo.toml

eframe = { version = "0.26", default-features = false, features = ["wgpu"] }

Errors with:

   Compiling eframe v0.26.2
error[E0599]: no variant or associated item named `Canvas` found for enum `SurfaceTarget` in the current scope
   --> /Users/cameron/.cargo/registry/src/index.crates.io-6f17d22bba15001f/eframe-0.26.2/src/web/web_painter_wgpu.rs:168:50
    |
168 |             .create_surface(wgpu::SurfaceTarget::Canvas(canvas.clone()))
    |                                                  ^^^^^^ variant or associated item not found in `SurfaceTarget<'_>`

For more information about this error, try `rustc --explain E0599`.

Also the latest from master

eframe = { git = "https://github.com/emilk/egui", branch = "master", default-features = false, features = [
  "wgpu",
] }

Gives the same error:

    Checking eframe v0.26.2 (https://github.com/emilk/egui?branch=master#e29022ef)
error[E0599]: no variant or associated item named `Canvas` found for enum `SurfaceTarget` in the current scope
   --> /Users/cameron/.cargo/git/checkouts/egui-5e4507fa4153be06/e29022e/crates/eframe/src/web/web_painter_wgpu.rs:168:50
    |
168 |             .create_surface(wgpu::SurfaceTarget::Canvas(canvas.clone()))
    |                                                  ^^^^^^ variant or associated item not found in `SurfaceTarget<'_>`
For more information about this error, try `rustc --explain E0599`.

It looks like the webgpu feature of the wgpu crate is no longer selected from egui-wgpu:

https://docs.rs/crate/egui-wgpu/0.26.2/source/Cargo.toml
https://docs.rs/crate/egui-wgpu/0.26.0/source/Cargo.toml

[dependencies.wgpu]
default-features = false
features = ["fragile-send-sync-non-atomic-wasm", "wgsl"]
version = "0.19.1"

Prior, it was not setting default-features = false.

https://docs.rs/crate/egui-wgpu/0.25.0/source/Cargo.toml

[dependencies.wgpu]
features = ["fragile-send-sync-non-atomic-wasm"]
version = "0.18.0"
@ctaggart ctaggart added the bug Something is broken label Mar 2, 2024
emilk pushed a commit that referenced this issue Mar 4, 2024
hacknus pushed a commit to hacknus/egui that referenced this issue Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant