metalangle
metalangle copied to clipboard
Building for visionOS (xrOS)
Hi,
Is it easy enough to add support for building with visionOS (xrOS) SDK ?
Both EAGLContext and CAEAGLLayer are not available on visionOS. Tested on Xcode 15.1 beta 3, visionOS SDK beta 6.
OpenGL ES framework is available on visionOS (although deprecated, as on all other Apple platforms). As seen here: https://developer.apple.com/documentation/opengles
We are interested in this as well. Notably, OpenGL ES and GLKit are described as not available in visionOS in the Apple docs:
In addition, on Xcode Version 15.0 beta 8 (15A5229m), I can confirm that attempts to build a visionOS app referencing either MetalANGLE-flavored framework will result in an error similar to below:
'glEnable' is unavailable: not available on visionOS
That error occurs even when MetalANGLE
is imported; clicking into glEnable
correctly opens the path project-root/Libraries/MetalANGLE.framework/Headers/GLES2/gl2.h
.
Lastly, when attempting to build the MetalANGLE SDK for native Vision Pro simulator, not Vision Pro (Designed for iPad), Vision Pro is not an option for building.
Maybe I'm missing something obvious, but why are you compiling in the OpenGLES backend? Just use the Metal backend and/or MGLKit.
Maybe I'm missing something obvious, but why are you compiling in the OpenGLES backend? Just use the Metal backend and/or MGLKit.
We are just unfamiliar how. Can you direct how we can exclude building the OpenGLES backend from the MetalAngle Xcode project?
@lirbar Have you tried simply removing the angle_gl_backend library from whatever target you're building?
@UInt2048 thank you! that worked. I needed to change a few small things but metalangle now builds and works as expected on visionOS.
Great news! Shall someone update the xcode example with a stripped back build with just what we need or please document steps required for visionOS linking success. Screenshot of project linked built binaries plz
Here is a zip file with the files I updated in order to build. Also included a new script: generate_MetalAngle_xcframework.sh
Which will create XCFramework for all Apple devices and simulators (iOS/iPadOS, macOS, Mac Catalyst, tvOS and visionOS). Just make sure you have all these SDKs installed in Xcode.
https://drive.google.com/file/d/1X9wJ8urgJmPql-pxFDWThd72gPYoImJv/view?usp=sharing
Thanks @lirbar legend!