-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangle.apple.patch
97 lines (93 loc) · 3.67 KB
/
angle.apple.patch
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
diff --git a/BUILD.gn b/BUILD.gn
index a82081b22..3399e0d31 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -694,6 +694,7 @@ angle_static_library("angle_gpu_info_util") {
if (is_apple) {
frameworks = [
+ "Foundation.framework",
"IOKit.framework",
"CoreFoundation.framework",
"CoreGraphics.framework",
@@ -703,12 +704,12 @@ angle_static_library("angle_gpu_info_util") {
} else if (angle_enable_cgl) {
frameworks += [ "OpenGL.framework" ]
}
- if (is_mac || angle_enable_cgl) {
+ if (is_mac || angle_enable_cgl || (is_ios && target_environment == "catalyst")) {
sources += libangle_gpu_info_util_mac_sources
- }
- if (is_ios && !angle_enable_cgl) {
+ } else if (is_ios) {
sources += libangle_gpu_info_util_ios_sources
}
+ defines += [ "GL_SILENCE_DEPRECATION" ]
}
}
diff --git a/src/common/system_utils.cpp b/src/common/system_utils.cpp
index 740384eaf..18de3eeec 100644
--- a/src/common/system_utils.cpp
+++ b/src/common/system_utils.cpp
@@ -226,7 +226,7 @@ void *OpenSystemLibraryAndGetError(const char *libraryName,
{
libraryWithExtension += dotExtension;
}
-#if ANGLE_PLATFORM_IOS_FAMILY
+#ifdef ANGLE_PLATFORM_APPLE
// On iOS, libraryWithExtension is a directory in which the library resides.
// The actual library name doesn't have an extension at all.
// E.g. "libEGL.framework/libEGL"
diff --git a/src/common/system_utils_mac.cpp b/src/common/system_utils_mac.cpp
index 2c48a7eb0..18d0b3231 100644
--- a/src/common/system_utils_mac.cpp
+++ b/src/common/system_utils_mac.cpp
@@ -23,6 +23,6 @@ namespace angle
{
const char *GetSharedLibraryExtension()
{
- return "dylib";
+ return "framework";
}
} // namespace angle
diff --git a/src/common/system_utils_posix.cpp b/src/common/system_utils_posix.cpp
index 76c5c99f0..a99eff17f 100644
--- a/src/common/system_utils_posix.cpp
+++ b/src/common/system_utils_posix.cpp
@@ -197,7 +197,12 @@ void *OpenSystemLibraryWithExtensionAndGetError(const char *libraryName,
std::string directory;
if (searchType == SearchType::ModuleDir)
{
-#if ANGLE_PLATFORM_IOS_FAMILY
+#if ANGLE_PLATFORM_MACOS || ANGLE_PLATFORM_MACCATALYST
+ // On macOS, shared libraries must be loaded from within the app bundle, in a directory
+ // next to the executable directory
+ directory = GetExecutableDirectory();
+ directory = directory.substr(0, directory.find_last_of('/')) + "/Frameworks/";
+#elif ANGLE_PLATFORM_IOS_FAMILY
// On iOS, shared libraries must be loaded from within the app bundle.
directory = GetExecutableDirectory() + "/Frameworks/";
#elif ANGLE_PLATFORM_FUCHSIA
diff --git a/src/gpu_info_util/SystemInfo_internal.h b/src/gpu_info_util/SystemInfo_internal.h
index 5cef5d49e..030d0ccad 100644
--- a/src/gpu_info_util/SystemInfo_internal.h
+++ b/src/gpu_info_util/SystemInfo_internal.h
@@ -43,7 +43,7 @@ uint64_t GetGpuIDFromOpenGLDisplayMask(uint32_t displayMask);
#endif
-#if defined(ANGLE_PLATFORM_MACOS) && ANGLE_ENABLE_METAL
+#if (defined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST)) && ANGLE_ENABLE_METAL
// Get VendorID from metal device's registry ID
VendorID GetVendorIDFromMetalDeviceRegistryID(uint64_t registryID);
#endif
diff --git a/src/libGLESv2.gni b/src/libGLESv2.gni
index 41bd81aa1..b6b36ccb4 100644
--- a/src/libGLESv2.gni
+++ b/src/libGLESv2.gni
@@ -127,7 +127,7 @@ if (is_apple) {
"src/common/system_utils_apple.cpp",
"src/common/system_utils_posix.cpp",
]
- if (is_mac) {
+ if (is_mac || (is_ios && target_environment == "catalyst")) {
libangle_common_sources += [
"src/common/gl/cgl/FunctionsCGL.cpp",
"src/common/gl/cgl/FunctionsCGL.h",