Add deprecation warning when running Metal on older OSes.

Older versions of MacOS are unstable when compiling shaders, and we
don't have the testing support for older versions of iOS.

Bug: skia:10777
Change-Id: I95d9fe0f1007af6bec5c7525dacda565e32989f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320260
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Jim Van Verth 2020-09-28 15:36:00 -04:00 committed by Skia Commit-Bot
parent c993fe60be
commit c2d10ef667
2 changed files with 15 additions and 0 deletions

View File

@ -9,6 +9,9 @@ Milestone 87
* <insert new release notes here>
* Added deprecation warning for Metal support on MacOS 10.13, iOS 8.3, and older.
https://review.skia.org/320260
* Update SkClipOp::kMax_EnumValue to include only intersect and difference when
SK_SUPPORT_DEPRECATED_CLIPOPS is not defined.
https://review.skia.org/320064

View File

@ -105,6 +105,18 @@ sk_sp<GrGpu> GrMtlGpu::Make(GrDirectContext* direct, const GrContextOptions& opt
if (!device || !queue) {
return nullptr;
}
if (@available(macOS 10.14, iOS 9.0, *)) {
// no warning needed
} else {
SkDebugf("*** Warning ***: this OS version is deprecated and will no longer be supported " \
"in future releases.\n");
#ifdef SK_BUILD_FOR_IOS
SkDebugf("Minimum recommended version is iOS 9.0.\n");
#else
SkDebugf("Minimum recommended version is MacOS 10.14.\n");
#endif
}
MTLFeatureSet featureSet;
if (!get_feature_set(device, &featureSet)) {
return nullptr;