emilk/egui

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

Aberta

#4.885 aberto em 28 de jul. de 2024

 (8 comentários) (1 reação) (0 responsável)Rust (2.104 forks)batch import
bugdocs and examplesegui-wgpuhelp wanted

Métricas do repositório

Stars
 (30.124 estrelas)
Métricas de merge de PR
 (Mesclagem média 17d 17h) (41 fundiu PRs em 30d)

Description

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

Guia do colaborador