src/common/apple_platform_utils.mm


Log

Author Commit Date CI Message
Avi Drissman d28c6adf 2025-06-19T09:41:26 Modernize for macOS 12 macOS 12 is the minimum OS requirement, so remove the "main port" workaround and do other modernization. Bug: b/40250210 Change-Id: I9638014732f0589fc6171c0fe617b3c563f00c28 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6655558 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
WeiCong Yu 90e3f6bd 2025-01-17T23:10:55 executable path has non-ASCII characters, metal not available On ARM64 MacOS 15.0.x, Metal Shader with newLibraryWithSource didn't work if the executable path contains non-ASCII characters. Bug: chromium:389559087 Change-Id: I0482c01e2a11973f56c712b36062ed78f3cecf9f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6174286 Reviewed-by: Quyen Le <lehoangquyen@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Kimmo Kinnunen b512e42d 2024-08-20T15:12:19 Reland: 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. Reland: Guard macOS specific unittests with compile guards. The patch changes the tested function to be macOS only. Bug: angleproject:360147118 Change-Id: Icbcc811a066995e742825a364fc5f0b5a27a59bc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5816832 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Geoff Lang <geofflang@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com>
Yuly Novikov 36f7e03a 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>
Kimmo Kinnunen a712626e 2024-08-20T15:12:19 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>
Kimmo Kinnunen e0f790c0 2024-08-20T12:08:40 Metal: Use present APIs for Metal availability Use non-deprecated APIs for checking Metal backend availability. macCatalyst and macOS needs MacFamily2 Availability: - macOS 10.15, minimum runtime 10.15 - macCatalyst 13.1, minimum runtime 16.5 iOS, minimum runtime 15.0, can always use the backend. Bug: angleproject:360147118 Change-Id: Id0b70c81bc8b54a22b94ba514aab148b202d58ef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5797053 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Dave Tapuska cd63c5d4 2024-02-21T14:36:57 Fix build failures targetting iOS 17.4 Add ifdefs to not use deprecated APIs. Bug: chromium:40254930 Change-Id: Id2155e5014558d0c62654cec01ee32119123037c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5315376 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Geoff Lang e62bd70a 2024-01-29T14:18:07 Metal: Disable Metal on older Mac models with GPU family 1. Skip the creation of the default Metal device entirely on macs that would not pass the GPU family checks. Bug: chromium:1322521 Change-Id: I7bdc3631125a0535370328b0e1bcba347cbbd5d0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5245647 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Alexey Knyazev 409bf134 2023-05-23T00:00:00 Metal: Adjust iOS and macCatalyst caps * Fix swapped iOS and macCatalyst versions for EXT_blend_func_extended and EXT_depth_clamp * Always use 13.1 as the lowest macCatalyst version Bug: angleproject:8121 Bug: angleproject:8047 Bug: angleproject:8015 Change-Id: I1f117de259d211cb8ce2463df59f8fee0e709ef5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4568323 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Kimmo Kinnunen f507fe05 2023-04-06T12:27:00 Rename PLATFORM_IOS to PLATFORM_IOS_FAMILY The current define ANGLE_PLATFORM_IOS actually means "iOS or tvOS or WatchOS or MacCatalyst". The current define ANGLE_PLATFORM_WATCHOS means nothing. The current define ANGLE_PLATFORM_APPLETV means nothing. Replace PLATFORM_IOS and its uses with PLATFORM_IOS_FAMILY, so that then PLATFORM_IOS can be reintroduced and others can be fixed. Replace PLATFORM_IOS_SIMULATOR and its uses with PLATFORM_IOS_FAMILY_SIMULATOR for consistency. Use consistent `#if X` notation instead of `#if defined(X)`. Bug: angleproject:8121 Change-Id: Ibe668c2ae9bb801d15e036fcf1dfd53f22c30787 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4404161 Reviewed-by: Dan Glastonbury <djg@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Seija K 081764c8 2023-01-23T16:18:23 Remove checks for A8 devices iOS 13 and above dropped support for A8. We do not need this code anymore. Bug: angleproject:7971 Change-Id: Ie1fca5d93be902605ce989c213df4f2677fe1597 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4190138 Reviewed-by: Dan Glastonbury <djg@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Dan Glastonbury 1d2b20f5 2022-12-23T14:21:10 Metal: Fix Metal API deprecation warnings macOS 13/iphoneOS 16 deprecated Metal APIs, causing warnings when building ANGLE targeting Ventura as the minimum supported OS. WebKit handles deprecated APIs by selectively silencing warnings around the affected code. This change adds ANGLE_APPLE_ALLOW_DEPRECATED_{BEGIN/END} and wraps code generating warnings to silence the warning. Bug: angleproject:7908 Change-Id: I7469652e0f4e0cf41ae3c295c2e3ae6bbd72e949 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4121822 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Yuly Novikov 1e32988c 2022-12-21T15:53:15 Revert "Metal: expose Metal backend only on supported GPUs." This reverts commit 9364246f08d34a378252e517210b68e97282f764. Reason for revert: iOS build fails Original change's description: > Metal: expose Metal backend only on supported GPUs. > > Query all the GPUs on the system during ANGLE's initialization, and do > not expose the EGL_ANGLE_platform_angle_metal client extension unless > all of them support the required GPU families or feature sets. > > Tested locally on a 2015 MacBook Pro with dual Intel Iris Pro and AMD > Radeon R9 M370X GPUs. The AMD GPU supports Metal GPU family macOS 2, > but the Intel GPU, only family macOS 1. With this change, Chrome > properly falls back to using ANGLE's OpenGL backend when > --use-angle=metal is specified, and renders correctly. > > Bug: chromium:1365598 > Change-Id: I2c3533afe733e0d06d7755cae272bbd12aa9e676 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4117716 > Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> > Reviewed-by: Gregg Tavares <gman@chromium.org> > Commit-Queue: Kenneth Russell <kbr@chromium.org> Bug: chromium:1365598 Change-Id: Iedbe8978f2a2d39a33359fa236a1d305c284266e No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4114291 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>
Kenneth Russell 9364246f 2022-12-19T16:28:44 Metal: expose Metal backend only on supported GPUs. Query all the GPUs on the system during ANGLE's initialization, and do not expose the EGL_ANGLE_platform_angle_metal client extension unless all of them support the required GPU families or feature sets. Tested locally on a 2015 MacBook Pro with dual Intel Iris Pro and AMD Radeon R9 M370X GPUs. The AMD GPU supports Metal GPU family macOS 2, but the Intel GPU, only family macOS 1. With this change, Chrome properly falls back to using ANGLE's OpenGL backend when --use-angle=metal is specified, and renders correctly. Bug: chromium:1365598 Change-Id: I2c3533afe733e0d06d7755cae272bbd12aa9e676 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4117716 Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Gregg Tavares <gman@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Kimmo Kinnunen e22eb503 2022-08-22T11:46:53 Metal: Report Metal being available on iOS simulator Make Metal backend always available on iOS simulator. Currently the GPU family query is not useful as it does not return anything that would enable Metal ANGLE to be used. However, testing on iOS simulator is still useful. Bug: angleproject:7591 Change-Id: I0aa881bb7482fc63bbaa08d5efc10920b3c1af43 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3845154 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Kenneth Russell 448e2275 2022-07-21T16:40:59 (Reland) [Metal] Disable ANGLE's Metal backend on older GPUs. Disable creation of EGL_PLATFORM_ANGLE_TYPE_METAL_ANGLE displays on: iOS: MTLGPUFamilyApple2 and older (A8 and older GPUs) macOS and Mac Catalyst: MTLGPUFamilyMac1 and older This is a partial integration of this recent WebKit fix: https://bugs.webkit.org/show_bug.cgi?id=242764 Refactored to eliminate duplicate copies of this code between libANGLE and the test suites. Changes since initial landing: - Explicitly link the angle_common static library against Metal.framework for the definition of MTLCreateSystemDefaultDevice, which was missing on the iOS Simulator. Fixed: angleproject:7514 Change-Id: I25028a298f1235db5b717ac6a1999552121d60c6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3806252 Commit-Queue: Geoff Lang <geofflang@chromium.org> Auto-Submit: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Yuly Novikov 8eaa0ccf 2022-08-02T12:03:21 Revert "[Metal] Disable ANGLE's Metal backend on older GPUs." This reverts commit cc2095d259222de434af06ce8515f17449a8f66d. Reason for revert: breaks rolling into Chromium https://ci.chromium.org/ui/p/chromium/builders/try/ios-simulator/1234241/overview Original change's description: > [Metal] Disable ANGLE's Metal backend on older GPUs. > > Disable creation of EGL_PLATFORM_ANGLE_TYPE_METAL_ANGLE displays on: > iOS: MTLGPUFamilyApple2 and older (A8 and older GPUs) > macOS and Mac Catalyst: MTLGPUFamilyMac1 and older > > This is a partial integration of this recent WebKit fix: > https://bugs.webkit.org/show_bug.cgi?id=242764 > > Refactored to eliminate duplicate copies of this code between libANGLE > and the test suites. > > Fixed: angleproject:7514 > Change-Id: I00dd1096bc8e72516f3f77fffcb7d4a886d6f2e4 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3780876 > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Kenneth Russell <kbr@chromium.org> Change-Id: If1e78ebc0c8e12a1fa0954d91bdd59fbd734251f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3804879 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>
Kenneth Russell cc2095d2 2022-07-21T16:40:59 [Metal] Disable ANGLE's Metal backend on older GPUs. Disable creation of EGL_PLATFORM_ANGLE_TYPE_METAL_ANGLE displays on: iOS: MTLGPUFamilyApple2 and older (A8 and older GPUs) macOS and Mac Catalyst: MTLGPUFamilyMac1 and older This is a partial integration of this recent WebKit fix: https://bugs.webkit.org/show_bug.cgi?id=242764 Refactored to eliminate duplicate copies of this code between libANGLE and the test suites. Fixed: angleproject:7514 Change-Id: I00dd1096bc8e72516f3f77fffcb7d4a886d6f2e4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3780876 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>