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

Investigate enabling Metal on iOS simulators above version 13.0. #52358

Closed
chinmaygarde opened this issue Mar 10, 2020 · 12 comments
Closed

Investigate enabling Metal on iOS simulators above version 13.0. #52358

chinmaygarde opened this issue Mar 10, 2020 · 12 comments
Labels
c: new feature Nothing broken; request for a new capability c: performance Relates to speed or footprint issues (see "perf:" labels) dependency: skia Skia team may need to help us engine flutter/engine repository. See also e: labels. P1 High-priority issues at the top of the work list perf: speed Performance issues related to (mostly rendering) speed platform-ios iOS applications specifically

Comments

@chinmaygarde
Copy link
Member

Metal is supported on iOS simulator versions above that level. However, it is not clear if the support is added via host passthrough or emulation. OpenGL emulation was found to be slower than just using the Skia software renderer directly. The same restrictions may apply to Metal as well if it is emulated on simulators. OTOH, if its just host passthrough, Metal on emulators should be a nice bump in rendering performance.

@chinmaygarde chinmaygarde added c: new feature Nothing broken; request for a new capability platform-ios iOS applications specifically engine flutter/engine repository. See also e: labels. labels Mar 10, 2020
@dnfield
Copy link
Contributor

dnfield commented Mar 11, 2020

From what I can tell it requires Catalina

@chinmaygarde
Copy link
Member Author

Attempting to query the device on the simulator and laptop reveals "Apple iOS simulator GPU" vs "AMD Radeon Pro 460". There may still be some form of passthrough. I am not sure about the performance. Will tackle this after Metal on iOS devices is done for now.

@chinmaygarde
Copy link
Member Author

chinmaygarde commented Mar 15, 2020

@dnfield
Copy link
Contributor

dnfield commented Mar 15, 2020

Yes, and from that doc:

Instead, Simulator translates any calls you make and directs them to the selected GPU on the host Mac.

@dnfield dnfield added the perf: speed Performance issues related to (mostly rendering) speed label Mar 15, 2020
@chinmaygarde
Copy link
Member Author

Yeah. I saw that. Its pretty exciting. Though, to be honest, most of the work necessary to support this will be in Skia. I'm setting up a call with some Skia folks to discuss unrelated Metal stuff next week. Will bring this up to see how much of an effort this will be.

@chinmaygarde chinmaygarde added the dependency: skia Skia team may need to help us label Mar 15, 2020
@liyuqian liyuqian added the c: performance Relates to speed or footprint issues (see "perf:" labels) label Mar 30, 2020
@chinmaygarde
Copy link
Member Author

Support for Metal in the simulators should be enabled in Skia after https://skia-review.googlesource.com/c/skia/+/282270. I'll gather guidance form the Skia folks of how this will be maintained moving forward. But excitingly, it did not seem very involved. Flutter engine should now be able to switch to Metal in metal_api_selection.mm based on simulator version. We should get a few perf numbers first before switching everyone to Metal. There is also the question of how Catalina simulators will be disambiguated at runtime.

@Kavantix
Copy link
Contributor

From my testing, the impact on simulator performance seems to be huge.
Even the unoptimized engine build feels smoother and uses less resources.

Also, when using metal, plugins like video_player work in the simulator.

@chinmaygarde
Copy link
Member Author

Sounds good. I have submitted the Skia patch blocking your draft PR. Let's land this thing and make the switch.

@chinmaygarde chinmaygarde added the P1 High-priority issues at the top of the work list label Jun 15, 2020
@diegoveloper
Copy link
Member

any news about this? I'm not sure why Flutter apps are running ok on iOS simulators without notch (iPhone 7/8/SE), after I try the app iPhone XR/11/11 Pro Max the animations/transitions look slow than normal. (native apps on Simulator run fine).

@dnfield
Copy link
Contributor

dnfield commented Oct 8, 2020

This has landed in the engine and should be available in the SDK soon. We can leave this open until it rolls in.

@dnfield
Copy link
Contributor

dnfield commented Oct 9, 2020

Available in SDK as of #67705

@dnfield dnfield closed this as completed Oct 9, 2020
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: new feature Nothing broken; request for a new capability c: performance Relates to speed or footprint issues (see "perf:" labels) dependency: skia Skia team may need to help us engine flutter/engine repository. See also e: labels. P1 High-priority issues at the top of the work list perf: speed Performance issues related to (mostly rendering) speed platform-ios iOS applications specifically
Projects
None yet
Development

No branches or pull requests

5 participants