Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building for visionOS (xrOS) #93

Open
lirbar opened this issue Nov 15, 2023 · 8 comments
Open

Building for visionOS (xrOS) #93

lirbar opened this issue Nov 15, 2023 · 8 comments

Comments

@lirbar
Copy link

lirbar commented Nov 15, 2023

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

@huntermonk
Copy link

We are interested in this as well. Notably, OpenGL ES and GLKit are described as not available in visionOS in the Apple docs:

image

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.

@UInt2048
Copy link

Maybe I'm missing something obvious, but why are you compiling in the OpenGLES backend? Just use the Metal backend and/or MGLKit.

@lirbar
Copy link
Author

lirbar commented Dec 14, 2023

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?

@UInt2048
Copy link

@lirbar Have you tried simply removing the angle_gl_backend library from whatever target you're building?

@lirbar
Copy link
Author

lirbar commented Dec 18, 2023

@UInt2048 thank you! that worked.
I needed to change a few small things but metalangle now builds and works as expected on visionOS.

@danoli3
Copy link

danoli3 commented Dec 18, 2023

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

@lirbar
Copy link
Author

lirbar commented Dec 18, 2023

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

@danoli3
Copy link

danoli3 commented Dec 18, 2023

Thanks @lirbar legend!

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

No branches or pull requests

4 participants