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

MGLKitSampleApp_ios9.0 crashes on launch on device running iOS 10.x #61

Open
mb12 opened this issue Jun 18, 2021 · 6 comments
Open

MGLKitSampleApp_ios9.0 crashes on launch on device running iOS 10.x #61

mb12 opened this issue Jun 18, 2021 · 6 comments
Labels

Comments

@mb12
Copy link

mb12 commented Jun 18, 2021

ERR: initialize(609): ANGLE Display::initialize error 12289: Could not create the EAGL context.
ERR: initialize(609): ANGLE Display::initialize error 12289: Could not create the EAGL context.
INFO: insertMessage(462): EGL CRITICAL: eglInitialize: Could not create the EAGL context.
(lldb) bt

@kakashidinho
Copy link
Owner

kakashidinho commented Jun 20, 2021

I don't have iOS 10.x devices but I tried to run on simulator, and couldn't reproduce this issue (at least with current master branch).

@mb12
Copy link
Author

mb12 commented Jun 20, 2021

It doesn't crash on the emulator for me either.
Could it be a 32-bit (armv7) vs 64-bit (arm64 issue)?
The device I am running it on is 32 bit.

@kakashidinho
Copy link
Owner

kakashidinho commented Jun 21, 2021

Based on your posted log messages. It seems the process failed at this line:

return egl::EglNotInitialized() << "Could not create the EAGL context.";

Which means mContext = [[EAGLContext alloc] initWithAPI:kGLESAPI]; failed. It's probably due to the phone's hardware doesn't support native OpenGL ES 3 (iPhone 5 and below).
This is the current limitation of MetalANGLE. On older devices, I fall back to use native OpenGL ES backend, but that back-end is not maintained by me. My main focus is Metal backend. OpenGL ES backend was maintained by upstream ANGLE and from what I know, they still support OpenGL ES 3.0+ hardwares only.

I don't think iPhone 5 and below have much market share currently. So they are low priorities in the support list.

@mb12
Copy link
Author

mb12 commented Jun 21, 2021

Thank you very much. Your analysis is correct. Once I made these changes it works.

//constexpr EAGLRenderingAPI kGLESAPI = kEAGLRenderingAPIOpenGLES3;
constexpr EAGLRenderingAPI kGLESAPI = kEAGLRenderingAPIOpenGLES2;

@Berstanio
Copy link
Contributor

I have a bit similar issue. But in my case I can run the sample (and any other app) on real devices flawless but I can't run them in any simulator. I get the following output which is a bit different to the one of this issue, but has the same eglError code: https://gist.github.com/Berstanio/81708a6431d0bcda2145143591062eec

//constexpr EAGLRenderingAPI kGLESAPI = kEAGLRenderingAPIOpenGLES3;
constexpr EAGLRenderingAPI kGLESAPI = kEAGLRenderingAPIOpenGLES2;

This change didn't fixed the issue.

I don't exactly know how the ios simulator works but a idea of mine was, that this could be related to the fact, that I run macos in a vm. Could this produce the issue? And if this is the case, is there any way to fix this?

@kakashidinho
Copy link
Owner

@Berstanio macos in a vm doesn't support metal, so it failed to create a metal device:

MTLCreateSystemDefaultDevice() zero devices

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants