-
Notifications
You must be signed in to change notification settings - Fork 6k
Remove #if SHELL_ENABLE_METAL checks in iOS code #51636
Conversation
I removed GL support from the macOS embedder and we don't have the software compositing fallback in that embedder, so should be safe to remove anything in the mac embedder if it still exists. Does the iOS embedder still support software rendering? I know we used to use it for simulators, but IIRC those moved to Metal. Or was simulator Metal adoption limited to arm64 macs? |
#include "flutter/shell/platform/darwin/ios/ios_context_metal_impeller.h" | ||
#include "flutter/shell/platform/darwin/ios/ios_context_metal_skia.h" | ||
#endif // SHELL_ENABLE_METAL | ||
#include "flutter/shell/platform/darwin/ios/ios_context_software.h" |
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.
Curious what this is still used for.
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.
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.
I suspect that all devices/simulators have metal support, but if so, I'd think we should be able to kill off the software rasterisation fallback. It seems a little contradictory to require metal but also support the software fallback.
lgtm modulo that question (and the question below as to whether we're still using it on simulators on intel).
The only time Flutter doesn't use Metal afaik is for iOS simulators running < iOS 13 #17881. However, I think to run an iOS 12 simulator you need an older version of Xcode than the current one, which itself needs to be run on an older version of macOS. It is still possible though with that setup. engine/shell/platform/darwin/ios/rendering_api_selection.h Lines 37 to 41 in 8a51e12
|
Oh also when software rendering is "forced" for simulators, forgot about that. Used for... scubas? |
I think we may need to continue to support softrware rendering until the Skia fallback is removed in favor of Impeller. #44346 engine/shell/platform/darwin/ios/ios_context.mm Lines 29 to 33 in 03cd54d
@bdero is that a true statement? |
Is that still a supported deployment target? If not, I'm all for scrub scrub scrub.
It's possible/likely it's changed since 2016 when @goderbauer and I wrote the original scuba support but I think at that point we were using the exact same underlying mechanism for screenshotting the tool uses -- i.e. wiring through the call to But now that you mention it, maybe we did force software rasterisation? Something about reproducible results? i.e. the same reason we run our GPU screenshot tests through SwiftShader in engine tests? The sad part is I think we'd need to work that out from the code, cause 2016 is definitely further back than I clearly remember, and either way, so much has changed that even if I could, the chance it still applies is near 0%. |
Technically yes, iOS 12 is the minimum supported. Though it is really tricky getting that simulator installed. We can rip out support next year when Apple (likely) drops support for it. |
…146300) flutter/engine@fa4d97e...e3104af 2024-04-04 [email protected] Remove #if SHELL_ENABLE_METAL checks in iOS code (flutter/engine#51636) 2024-04-04 [email protected] Roll Skia from d58a6dbaaadb to f9dfb0308594 (1 revision) (flutter/engine#51913) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sigh, yes, scubas. Reverting. |
A reason for requesting a revert of flutter/engine/51636 could |
Reason for revert: This caused a slew of unexpected Scuba changes b/333039358 |
This reverts commit e3104af.
…51941) Reverts: #51636 Initiated by: jmagman Reason for reverting: This caused a slew of unexpected Scuba changes b/333039358 Original PR Author: jmagman Reviewed By: {cbracken} This change reverts the following previous change: All physical iOS devices Flutter supports (iOS 12+) can run Metal. The only time Flutter doesn't use Metal afaik is for iOS simulators running < iOS 13, which is covered by a few `if (@available(iOS METAL_IOS_VERSION_BASELINE, *))` checks. https://github.com/flutter/engine/blob/8a51e124fbf168295a1b05f8d66459bfb29ae8a9/shell/platform/darwin/ios/rendering_api_selection.h#L37-L41 Remove hardware checks for physical devices. Remove `shell_enable_metal` from the gn files and the `#if SHELL_ENABLE_METAL` checks in the iOS embedder. I limited this PR to just iOS, but I imagine it's safe to remove `shell_enable_metal` everywhere? https://github.com/flutter/engine/blob/41da00ac46bc38a97a63ed0635450271d71afd9f/shell/platform/darwin/macos/BUILD.gn#L18 https://github.com/flutter/engine/blob/41da00ac46bc38a97a63ed0635450271d71afd9f/tools/gn#L673-L679
@@ -18,18 +16,6 @@ | |||
|
|||
namespace flutter { | |||
|
|||
#if SHELL_ENABLE_METAL | |||
bool ShouldUseMetalRenderer() { |
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.
Removing this is likely what broke the google3 test harness. Despite running on a version of iOS sim that is required to support metal - due to the lack of supported GPU passthrough (and in defiance of all that is holy), creation of the MTLDevice will fail.
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.
Makes sense, I'll fix it up. Thank you for looking at it!
All physical iOS devices Flutter supports (iOS 12+) can run Metal. The only time Flutter doesn't use Metal afaik is for iOS simulators running < iOS 13, which is covered by a few `if (@available(iOS METAL_IOS_VERSION_BASELINE, *))` checks. https://github.com/flutter/engine/blob/8a51e124fbf168295a1b05f8d66459bfb29ae8a9/shell/platform/darwin/ios/rendering_api_selection.h#L37-L41 Remove hardware checks for physical devices. Remove `shell_enable_metal` from the gn files and the `#if SHELL_ENABLE_METAL` checks in the iOS embedder. I limited this PR to just iOS, but I imagine it's safe to remove `shell_enable_metal` everywhere? https://github.com/flutter/engine/blob/41da00ac46bc38a97a63ed0635450271d71afd9f/shell/platform/darwin/macos/BUILD.gn#L18 https://github.com/flutter/engine/blob/41da00ac46bc38a97a63ed0635450271d71afd9f/tools/gn#L673-L679
Same as #51636 except: 1. The original change caused scuba changes because those simulators are running on Macs without GPU passthrough, and so fallback to software rendering when `MTLCreateSystemDefaultDevice()` fails. Re-add that `MTLCreateSystemDefaultDevice` check https://github.com/flutter/engine/pull/51636/files#diff-1db60a8a74c1cfb40c970541dd1f7f0f6301853a2ba17451f5117f154036d732L22-L31 2. Set `enable_metal` to always true for `macos/BUILD.gn` [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
…lutter#146300) flutter/engine@fa4d97e...e3104af 2024-04-04 [email protected] Remove #if SHELL_ENABLE_METAL checks in iOS code (flutter/engine#51636) 2024-04-04 [email protected] Roll Skia from d58a6dbaaadb to f9dfb0308594 (1 revision) (flutter/engine#51913) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
All physical iOS devices Flutter supports (iOS 12+) can run Metal. The only time Flutter doesn't use Metal afaik is for iOS simulators running < iOS 13, which is covered by a few
if (@available(iOS METAL_IOS_VERSION_BASELINE, *))
checks.engine/shell/platform/darwin/ios/rendering_api_selection.h
Lines 37 to 41 in 8a51e12
Remove hardware checks for physical devices.
Remove
shell_enable_metal
from the gn files and the#if SHELL_ENABLE_METAL
checks in the iOS embedder.I limited this PR to just iOS, but I imagine it's safe to remove
shell_enable_metal
everywhere?engine/shell/platform/darwin/macos/BUILD.gn
Line 18 in 41da00a
engine/tools/gn
Lines 673 to 679 in 41da00a