feat(visionos): add native visionOS engine target#68
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 fromnative/tvos(UIKit scene +CAMetalLayer+ wgpu, touch handlers, audio backend):bloom_get_platform()→9.0metal-patchedcrate (it already carries thetarget_os = "visionos"cfg arms) via a siblingpath = "../tvos/metal-patched"to avoid duplicating ~70 vendored files. The published package shipsnative/tvos/metal-patched, so the relative path resolves there too.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'stouchesBegan. Without it, a pinch arrives as a plainUITouchat the gaze location and the game's touch/pinch controls work. A physical Bluetooth controller is still detected.package.json—perry.nativeLibrary.targets.visionos(frameworks + libc++, mirroring tvOS) andfiles[]entries.src/core/index.ts—Platform.VISIONOS = 9.Build notes
aarch64-apple-visionosand-simare tier-2 Rust targets (no-Zbuild-std).--no-default-features, as via perry's[native-library]forwarding) build with no Jolt — confirmed compiling for-sim. Full (Jolt-on) builds would need avisionosslice in@bloomengine/jolt-prebuilt(not part of this PR).Companion
Requires matching perry support — the
visionos+ios-game-loopclang 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.