Skip to content

fix(gpu): the native Metal backend is chosen only from macOS 13 and iOS 16, and older systems draw with wgpu - #1590

Merged
Hona merged 1 commit into
devfrom
fix/588-metal-floor
Nov 23, 2026
Merged

Hona merged 1 commit into
devfrom
fix/588-metal-floor

Conversation

@Hona

@Hona Hona commented Nov 23, 2026

Copy link
Copy Markdown
Member

Refs #588

Part 3 of #588: the native Metal backend no longer runs on systems it can't build pipelines for.

What was wrong

  • rune-gpu/src/backend.rs made GpuBackend::Metal the default on every macOS when metal-backend is on, which it is by default.
  • That backend writes MSL 3.0 (metal/device.rs msl_version falls to 3.0 below macOS 14), and its precompiled libraries are built with -mmacosx-version-min=13.0 (render/metallib.rs).
  • On macOS 11 and 12, the libraries don't load and the runtime compile fails, so metal/pipeline.rs panics and an app with default features opens no window.

What changed

pub fn current() -> GpuBackend {
    let backend = gate(resolve(env().as_deref(), chosen()), os_major());
    // …says once on stderr when the app or RUNE_GPU_BACKEND asked for Metal
}

fn gate(backend: GpuBackend, os_major: Option<u32>) -> GpuBackend // Metal below macOS 13 / iOS 16 -> Wgpu
  • os_major reads kern.osproductversion once. An unknown version keeps the choice.
  • The floor holds over RUNE_GPU_BACKEND=metal and App::gpu_backend(Metal) too.
  • describe gives the reason.

Tests

  • backend::tests::the_native_backend_falls_back_to_wgpu_below_its_os_floor (macOS 11, 12, 13, 26, unknown).
  • Built and tested on macOS 26. Nobody here runs macOS 11 or 12. Someone with one of those systems can run cargo run -p rune --example <any> with RUNE_GPU_LOG=1 and check that it says wgpu Metal … (Rune's Metal backend needs macOS 13 or iOS 16).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant