-
-
Notifications
You must be signed in to change notification settings - Fork 295
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
Rebased iOS Metal support branch #369
Conversation
c4356be
to
b67639c
Compare
I've kicked off the GitHub Action check(s). It looks like we will have a new branch called I recommend that we lock the |
I vote that we merge this into |
All
|
@@ -4,11 +4,7 @@ | |||
|
|||
#include <mbgl/gl/renderable_resource.hpp> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this file should be renamed MGLMapView+OpenGL.mm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is still pretty much OpenGL
🤔 it's really just the overriding header files and bundled MetalANGLE
doing the transition magic. I think there's a plan to rewrite the SDK in native Metal, that would be a good opportunity for changes – till that time, the SDK is formally still OpenGL.
I seems like https://github.com/maplibre/maplibre-gl-native/blob/main/platform/darwin/src/gl_functions.cpp |
I tried out a build of this and I see the following things in the terminal. It seem to all come out of the SDK when the map is initially initialized. The SDK warnings require you to hook into collecting logs from the SDK itself but the other things appear to just appear in Xcode without that.
|
I also get a blue or black map on simulator. I'm not sure if you get that as well. On device it appears to work fine though. |
3871094
to
3203e75
Compare
Thanks for your feedback, @nvanfleet! Ad the vertex array warnings: bool Context::supportsVertexArrays() const {
// TODO: Metal: Metal does not work with vertex arrays.
return false;
}
...
if (!supportsVertexArrays()) {
Log::Warning(Event::OpenGL, "Not using Vertex Array Objects");
} Citation from the WIP Metal code here, I'd say this warning could be just dropped at this point if linked against Metal? The guys will figure out. Ad Metal/shader code warnings: I know about these, but I haven't yet found where these are stored, I'm suspecting these to be coded somewhere (possibly in some shared context) so I'm not sure how to handle that against all platforms – again, somebody smarter needs to do it right. 😄 Ad blue or black map: do you refer to the Update: the up-to-date MapLibre Basic style works, in terms of showing something relevant when running. 😄 The branch is now rebased with it. My job here (for our project's purpose) is just to make it buildable & usable while considering its state at this point, but I'm sure MapLibre guys will polish it as needed. 👌 |
3203e75
to
5a1eb47
Compare
5a1eb47
to
eef723a
Compare
eef723a
to
4091007
Compare
Rebased once again, replacing the bundled Later on, it would probably be best to include |
…NGLE XCFramework used Xcode 14 will soft-limit deployment to iOS 11 (thus 64-bit only) anyway.
4091007
to
70b9ec9
Compare
70b9ec9
to
916c595
Compare
Please see the proposals below for the design of the upcoming Metal support:
A team of graphics engineers is implementing this approach right now in favour of MetalANGLE, so I don't think it makes sense to merge this at this point in time. |
TL;DR:
metal-support
branchmain
metal-support
branchmain
which might be caused by the same set of changesMetalANGLE.xcframework
In this state it's definitely not meant to be merged, more like added as an official branch after some polishing. Feel free to post suggestions & push improvements so that the Metal support could be pushed forward for once. 👍
From my experience, the Metal-backed runtime is quite smooth, yet I've experienced some FPS drops to ~40fps, maybe caused by the reverted rendering flow code & synchronisation of
UIKit
/CoreAnimation
layers. Hopefully somebody way more experienced in OpenGL/Metal field will be able to help optimising it.A couple of link references so that this PR gets some attention:
P.S.: When checking the code, skip the
vendor
folder as that currently contains the bundledMetalANGLE
framework with quite heavy header files. 😅 That's why the abysmal+/-
stats of this PR.