Skip to content

feat(visionos): add native visionOS engine target#68

Merged
proggeramlug merged 1 commit into
mainfrom
feat/visionos-support
Jun 13, 2026
Merged

feat(visionos): add native visionOS engine target#68
proggeramlug merged 1 commit into
mainfrom
feat/visionos-support

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

What

Adds Apple Vision Pro (visionOS) as a native engine target, so a Bloom game can compile and run on visionOS — rendering in a flat window in the Shared Space with a UIKit + Metal/wgpu game loop (the same model as tvOS/iOS, not the watchOS SwiftUI-Canvas path).

Verified end-to-end with Bloom Jump: builds for aarch64-apple-visionos (device) and -sim, runs in the Vision Pro simulator (title screen + gameplay), with eye+pinch driving the on-screen touch controls.

Changes

  • native/visionos/ crate — cloned from native/tvos (UIKit scene + CAMetalLayer + wgpu, touch handlers, audio backend):
    • bloom_get_platform()9.0
    • shares tvOS's vendored metal-patched crate (it already carries the target_os = "visionos" cfg arms) via a sibling path = "../tvos/metal-patched" to avoid duplicating ~70 vendored files. The published package ships native/tvos/metal-patched, so the relative path resolves there too.
    • Omits GCVirtualController. On visionOS the system virtual-controller overlay sits on top of the window and swallows indirect (eye+pinch) input as its own d-pad/button presses, so pinches never reach the Metal view's touchesBegan. Without it, a pinch arrives as a plain UITouch at the gaze location and the game's touch/pinch controls work. A physical Bluetooth controller is still detected.
  • package.jsonperry.nativeLibrary.targets.visionos (frameworks + libc++, mirroring tvOS) and files[] entries.
  • src/core/index.tsPlatform.VISIONOS = 9.

Build notes

  • aarch64-apple-visionos and -sim are tier-2 Rust targets (no -Zbuild-std).
  • Pure-2D games (--no-default-features, as via perry's [native-library] forwarding) build with no Jolt — confirmed compiling for -sim. Full (Jolt-on) builds would need a visionos slice in @bloomengine/jolt-prebuilt (not part of this PR).

Companion

Requires matching perry support — the visionos + ios-game-loop clang link path and the runtime game-loop module gate. That's a separate PR against the perry repo; this engine PR is the native-layer half.

Adds a `native/visionos` crate (UIKit + Metal/wgpu game-loop backend,
cloned from `native/tvos`) plus manifest wiring so games can target
Apple Vision Pro.

- native/visionos: bloom_get_platform() -> 9.0; shares tvOS's vendored
  metal-patched crate (already carries the visionos cfg arms) via a
  sibling path to avoid duplicating it.
- Omits GCVirtualController: on visionOS its on-screen overlay swallows
  indirect (eye+pinch) input, so pinches never reach the Metal view's
  touch handlers. Without it a pinch arrives as a plain UITouch at the
  gaze location and touch/pinch controls work; a physical Bluetooth
  controller is still picked up.
- package.json: nativeLibrary.targets.visionos + files[] entries.
- core: Platform.VISIONOS = 9.

Builds for aarch64-apple-visionos{,-sim}. Pure-2D (--no-default-features)
needs no Jolt prebuilt. Requires matching perry support (the visionos
ios-game-loop clang link path) — separate PR.
@proggeramlug proggeramlug merged commit 4a42210 into main Jun 13, 2026
9 checks passed
@proggeramlug proggeramlug deleted the feat/visionos-support branch June 13, 2026 12:04
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