Hash :
36f7e03a
Author :
Date :
2024-08-21T13:49:10
Revert "Metal: Fix availability for kIOMainPortDefault" This reverts commit a712626e940cbd3ff6f279a6e838362392a3fd1d. Reason for revert: breaks iOS https://chromium-review.googlesource.com/c/chromium/src/+/5802272 https://ci.chromium.org/ui/p/chromium/builders/try/ios-simulator/2048194/overview Original change's description: > Metal: Fix availability for kIOMainPortDefault > > Remove ad hoc deprecation disables for > kIOMasterPortDefault. > macCatalyst kIOMainPortDefault available 15.0, > less than minimum 15.6. Remove the ifdefs. > > Bug: angleproject:360147118 > Change-Id: I2ccc08814e267984ff53275cc2886e2bfa8d4c2a > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5797149 > Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> > Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com> Bug: angleproject:360147118 Change-Id: Iab3e8d1dece4866732ecbebab4c83f274b99e034 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5803985 Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: Yuly Novikov <ynovikov@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
//
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// apple_platform_utils.h: Common utilities for Apple platforms.
#ifndef COMMON_APPLE_PLATFORM_UTILS_H_
#define COMMON_APPLE_PLATFORM_UTILS_H_
#include "common/platform.h"
#include <string>
// These are macros for substitution of Apple specific directive @available:
// TARGET_OS_MACCATALYST only available in MacSDK 10.15
#if TARGET_OS_MACCATALYST
// ANGLE_APPLE_AVAILABLE_XCI: check if either of the 3 platforms (OSX/Catalyst/iOS) min verions is
// available:
# define ANGLE_APPLE_AVAILABLE_XCI(macVer, macCatalystVer, iOSVer) \
@available(macOS macVer, macCatalyst macCatalystVer, iOS iOSVer, *)
// ANGLE_APPLE_AVAILABLE_XC: check if either of the 2 platforms (OSX/Catalyst) min verions is
// available:
# define ANGLE_APPLE_AVAILABLE_XC(macVer, macCatalystVer) \
@available(macOS macVer, macCatalyst macCatalystVer, *)
// ANGLE_APPLE_AVAILABLE_CI: check if either of the 2 platforms (Catalyst/iOS) min verions is
// available:
# define ANGLE_APPLE_AVAILABLE_CI(macCatalystVer, iOSVer) \
@available(macCatalyst macCatalystVer, iOS iOSVer, *)
#else
# define ANGLE_APPLE_AVAILABLE_XCI(macVer, macCatalystVer, iOSVer) \
ANGLE_APPLE_AVAILABLE_XI(macVer, iOSVer)
# define ANGLE_APPLE_AVAILABLE_XC(macVer, macCatalystVer) @available(macOS macVer, *)
# define ANGLE_APPLE_AVAILABLE_CI(macCatalystVer, iOSVer) @available(iOS iOSVer, tvOS iOSVer, *)
#endif
// ANGLE_APPLE_AVAILABLE_XI: check if either of the 2 platforms (OSX/iOS) min verions is available:
#define ANGLE_APPLE_AVAILABLE_XI(macVer, iOSVer) \
@available(macOS macVer, iOS iOSVer, tvOS iOSVer, *)
// ANGLE_APPLE_AVAILABLE_I: check if a particular iOS version is available
#define ANGLE_APPLE_AVAILABLE_I(iOSVer) @available(iOS iOSVer, tvOS iOSVer, *)
#if TARGET_OS_IPHONE
# if !defined(__IPHONE_11_0)
# define __IPHONE_11_0 110000
# endif
# if !defined(__IPHONE_OS_VERSION_MAX_ALLOWED)
# define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_11_0
# endif
# if !defined(__TV_OS_VERSION_MAX_ALLOWED)
# define __TV_OS_VERSION_MAX_ALLOWED __IPHONE_11_0
# endif
#endif
#if !defined(TARGET_OS_MACCATALYST)
# define TARGET_OS_MACCATALYST 0
#endif
#if defined(__ARM_ARCH)
# define ANGLE_APPLE_IS_ARM (__ARM_ARCH != 0)
#else
# define ANGLE_APPLE_IS_ARM 0
#endif
#define ANGLE_APPLE_OBJC_SCOPE @autoreleasepool
#if !__has_feature(objc_arc)
# define ANGLE_APPLE_AUTORELEASE autorelease
# define ANGLE_APPLE_RETAIN retain
# define ANGLE_APPLE_RELEASE release
#else
# define ANGLE_APPLE_AUTORELEASE self
# define ANGLE_APPLE_RETAIN self
# define ANGLE_APPLE_RELEASE self
#endif
#define ANGLE_APPLE_UNUSED __attribute__((unused))
#if __has_warning("-Wdeprecated-declarations")
# define ANGLE_APPLE_ALLOW_DEPRECATED_BEGIN \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
#else
# define ANGLE_APPLE_ALLOW_DEPRECATED_BEGIN
#endif
#if __has_warning("-Wdeprecated-declarations")
# define ANGLE_APPLE_ALLOW_DEPRECATED_END _Pragma("GCC diagnostic pop")
#else
# define ANGLE_APPLE_ALLOW_DEPRECATED_END
#endif
namespace angle
{
bool IsMetalRendererAvailable();
bool GetMacosMachineModel(std::string *outMachineModel);
bool ParseMacMachineModel(const std::string &identifier,
std::string *type,
int32_t *major,
int32_t *minor);
} // namespace angle
#endif