emilk/egui

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

Open

#4,885 建立於 2024年7月28日

在 GitHub 查看
 (8 留言) (1 反應) (0 負責人)Rust (2,037 fork)batch import
bugdocs and examplesegui-wgpuhelp wanted

倉庫指標

Star
 (29,051 star)
PR 合併指標
 (平均合併 11天 20小時) (30 天內合併 47 個 PR)

描述

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 :)

貢獻者指南