Skip to content

requirement for users to select wgpu features is undocumented & resulting errors hard to interpret #4885

Open
@kametsuu

Description

@kametsuu

Describe the bug
DirectX12 doesn't work with eframe and errors with error:

[2024-07-28T19:05:15Z ERROR eframe::native::run] Exiting because of error: WGPU error: Failed to create surface for any enabled backend: {} during event Resumed
Error: Wgpu(CreateSurfaceError(CreateSurfaceError { inner: Hal(FailedToCreateSurfaceForAnyBackend({})) }))
error: process didn't exit successfully: `target\debug\dx12eframe.exe` (exit code: 1)

Here is minimal example:

Cargo.toml

[package]
name = "dx12eframe"
version = "0.1.0"
edition = "2021"

[dependencies]
eframe = { version = "0.28.0", features = ["wgpu"] }
env_logger = "0.11.5"

main.rs

use eframe::egui;

fn main() -> Result<(), eframe::Error> {
    env_logger::init();

    let native_options = eframe::NativeOptions {
        renderer: eframe::Renderer::Wgpu,
        wgpu_options: eframe::egui_wgpu::WgpuConfiguration {
            supported_backends: eframe::wgpu::Backends::DX12,
            ..Default::default()
        },
        ..Default::default()
    };

    eframe::run_simple_native("Hello world", native_options, move |ctx, _frame| {
        egui::CentralPanel::default().show(ctx, |ui| {
            ui.heading("Hello world");
        });
    })
}

It's only happening for me while using DX12 (GL and Vulkan works fine). But when I use only wgpu with winit (exactly code from here) it works, so I guess it must be a bug in egui/eframe (that's why I post issue here).

Desktop:

  • OS: Windows 11 Pro 23H2
  • Version: eframe 28 & 28.1 (I can't check older versions, because I have some compilation errors on versions <28)
  • Adapter info using wgpu: {
    name: "NVIDIA GeForce RTX 2070 SUPER",
    vendor: 4318,
    device: 7812,
    device_type: DiscreteGpu,
    driver: "31.0.15.4617",
    driver_info: "",
    backend: Dx12,
    }

If there's anything else you need me to provide or check then just say :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is brokendocs and examplesImproving and adding documentation and examplesegui-wgpuhelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions