Skip to main content

gpu_backends

Function gpu_backends 

Source
pub const fn gpu_backends() -> Backends
Expand description

Platform-appropriate wgpu backend mask for adapter enumeration.

PMAT-927 (class follow-up to PMAT-925): wgpu::Backends::all() includes wgpu::Backends::GL, which on Linux hosts that expose both Vulkan and GLES/EGL (notably the intel AMD-RADV cross-silicon baseline box) instantiates a GLES adapter whose EglContext::make_current panics inside Drop. A panic in a destructor during cleanup aborts the whole process with SIGABRT (“panic in a destructor during cleanup”); standalone enumeration can also spin/hang on the broken EGL path. The compute kernels themselves are correct — the fragility is purely in adapter enumeration and the GLES Drop path.

We return wgpu::Backends::PRIMARY, which in wgpu 22 (this crate’s pin) is VULKAN | METAL | DX12 | BROWSER_WEBGPU and excludes GL (GL lives only in Backends::SECONDARY). This keeps the real GPU on every platform — Vulkan on Linux/AMD-RADV, Metal on Apple, DX12 on Windows — while guaranteeing the broken GLES/EGL adapter is never created.

The mask is applied at BOTH the wgpu::Instance construction site (so the GLES backend is never even registered on the instance) and every enumerate_adapters call site.