zed-industries/zed · error

Surface reports no supported alpha modes for adapter {:?}

Error message

Surface reports no supported alpha modes for adapter {:?}

What it means

Raised in the internal `WgpuRenderer` constructor when the surface's supported alpha modes list is empty, so no CompositeAlphaMode (PreMultiplied/PostMultiplied preferred) can be selected. Indicates a broken adapter/surface pairing, similar to the no-formats case.

Source

Thrown at crates/gpui_wgpu/src/wgpu_renderer.rs:375

            .copied()
            .or_else(|| surface_caps.formats.iter().find(|f| !f.is_srgb()).copied())
            .or_else(|| surface_caps.formats.first().copied())
            .ok_or_else(|| {
                anyhow::anyhow!(
                    "Surface reports no supported texture formats for adapter {:?}",
                    context.adapter.get_info().name
                )
            })?;

        let pick_alpha_mode =
            |preferences: &[wgpu::CompositeAlphaMode]| -> anyhow::Result<wgpu::CompositeAlphaMode> {
                preferences
                    .iter()
                    .find(|p| surface_caps.alpha_modes.contains(p))
                    .copied()
                    .or_else(|| surface_caps.alpha_modes.first().copied())
                    .ok_or_else(|| {
                        anyhow::anyhow!(
                            "Surface reports no supported alpha modes for adapter {:?}",
                            context.adapter.get_info().name
                        )
                    })
            };

        let transparent_alpha_mode = pick_alpha_mode(&[
            wgpu::CompositeAlphaMode::PreMultiplied,
            wgpu::CompositeAlphaMode::Inherit,
        ])?;

        let opaque_alpha_mode = pick_alpha_mode(&[
            wgpu::CompositeAlphaMode::Opaque,
            wgpu::CompositeAlphaMode::Inherit,
        ])?;

        let alpha_mode = if config.transparent {
            transparent_alpha_mode

View on GitHub (pinned to f4178619ac)

Solutions

  1. Recreate the surface and adapter pairing; an empty alpha mode list indicates an invalid surface state.
  2. Default to CompositeAlphaMode::Auto when capabilities are suspect.
  3. Verify against wgpu version-specific backend bugs (e.g. certain Wayland/GL surfaces).
  4. Report the adapter backend/name in the error context for debugging.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at crates/gpui_wgpu/src/wgpu_renderer.rs:375 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/99a9efd76f392a80. Report an issue: GitHub.