Cannot detect wgpu backend on Windows 11
- Dominant language
- Rust
- Stars
- 30.6k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 72
Description
**Describe the bug**
When using eframe with the `wgpu` feature on Windows, the application panics at runtime with the error:
```
No wgpu backend feature that is implemented for the target platform was enabled. See `wgpu::Instance::enabled_backend_features()` for more information.
```
This happens because the default wgpu configuration in eframe/egui-wgpu only enables the `wgsl` feature, which is insufficient for Windows. On Windows, wgpu requires explicit enabling of either the `dx12` or `vulkan` backend feature.
#7106 reported the same error, but that was on Linux, not on Windows.
**To Reproduce**
Steps to reproduce the behavior:
1. Create a new Rust project with eframe dependency using only the `wgpu` feature (not `glow`):
```toml
eframe = { version = "0.33", default-features = false, features = ["wgpu", "persistence", "default_fonts"] }
```
2. Build and run the application on Windows
3. See panic with the error message described above
**Expected behavior**
The application should either:
- Work out-of-the-box with wgpu on Windows (by enabling appropriate backend features automatically), OR
- Provide a clear compile-time or runtime error explaining that Windows requires additional wgpu features to be enabled
**Screenshots**
**Desktop (please complete the following information):**
- OS: Windows 11
- Browser: N/A (desktop application)
- Version: egui 0.33.3, eframe 0.33.3, wgpu 27
**Smartphone (please complete the following information):**
- Device: N/A
- OS: N/A
- Browser: N/A
- Version: N/A
**Additional context**
The workaround is to add the following to your `Cargo.toml`:
```toml
[target.'cfg(windows)'.dependencies]
wgpu = { version = "27", features = ["dx12"] }
```
This issue is similar to problems users face when trying to use wgpu without the correct backend features enabled for their target platform. The documentation could be improved by adding a note about required platform-specific wgpu features.
Contributor guide
Research direction
Start by reproducing the panic with the eframe dependency configuration in Cargo.toml on Windows, then inspect wgpu::Instance::enabled_backend_features and the eframe/egui-wgpu feature configuration. Done should mean the Windows wgpu setup works with the documented configuration or reports a clear requirement for platform-specific backend features.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100