77#include < Foundation/Foundation.h>
88#include < QuartzCore/CAEAGLLayer.h>
99#include < QuartzCore/CAMetalLayer.h>
10+ #if FLUTTER_SHELL_ENABLE_METAL
11+ #include < Metal/Metal.h>
12+ #endif // FLUTTER_SHELL_ENABLE_METAL
1013
1114#include " flutter/fml/logging.h"
1215
@@ -16,6 +19,7 @@ bool ShouldUseSoftwareRenderer() {
1619 return [[[NSProcessInfo processInfo ] arguments ] containsObject: @" --force-software" ];
1720}
1821
22+ #if FLUTTER_SHELL_ENABLE_METAL
1923bool ShouldUseMetalRenderer () {
2024 // If there is a command line argument that says Metal should not be used, that takes precedence
2125 // over everything else. This allows disabling Metal on a per run basis to check for regressions
@@ -31,11 +35,13 @@ bool ShouldUseMetalRenderer() {
3135 return true ;
3236 }
3337
34- // This is just a version we picked that is easy to support and has all necessary Metal features.
38+ // Flutter supports Metal on all devices with Apple A7 SoC or above that have been update to or
39+ // past iOS 10.0. The processor was selected as it is the first version at which Metal was
40+ // supported. The iOS version floor was selected due to the availability of features used by Skia.
3541 bool ios_version_supports_metal = false ;
36- // TODO(52356): Update this to be the version selected for release.
37- if (@ available (iOS 11.0 , *)) {
38- ios_version_supports_metal = true ;
42+ if (@ available (iOS 10.0 , *)) {
43+ auto device = MTLCreateSystemDefaultDevice ();
44+ ios_version_supports_metal = [device supportsFeatureSet: MTLFeatureSet_iOS_GPUFamily1_v3] ;
3945 }
4046
4147 // The application must opt-in by default to use Metal without command line flags.
@@ -44,6 +50,7 @@ bool ShouldUseMetalRenderer() {
4450
4551 return ios_version_supports_metal && application_opts_into_metal;
4652}
53+ #endif // FLUTTER_SHELL_ENABLE_METAL
4754
4855IOSRenderingAPI GetRenderingAPIForProcess () {
4956#if TARGET_IPHONE_SIMULATOR
0 commit comments