Bug 224337

Summary: [Metal-ANGLE] Support GPU power preferences, select low-power GPU by default.
Product: WebKit Reporter: Kyle Piddington <kpiddington>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: dino, ews-watchlist, graouts, jonlee, kkinnunen, kondapallykalyan, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Kyle Piddington 2021-04-08 13:00:29 PDT
[Metal-ANGLE] Support GPU power preferences, select low-power GPU by default.
Comment 1 Kyle Piddington 2021-04-08 13:01:28 PDT
Created attachment 425537 [details]
Patch
Comment 2 EWS Watchlist 2021-04-08 13:02:16 PDT
Note that there are important steps to take when updating ANGLE. See https://trac.webkit.org/wiki/UpdatingANGLE
Comment 3 Jon Lee 2021-04-08 15:27:13 PDT
rdar://75823830
Comment 4 Dean Jackson 2021-04-08 15:43:41 PDT
Comment on attachment 425537 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=425537&action=review

> Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/DisplayMtl.mm:278
> +    //TODO: External GPU support. Do we prefer high power / low bandwidth for general WebGL applications?
> +    //      Can we support hot-swapping in GPU's?

This is a good question. I would assume that if someone has an external GPU they want to use it. And it is likely that their display is running through it or, even if it's a laptop, they are using it as the primary display. So we should probably use any external GPU before even checking for the low-power/high-power flag. But this doesn't need to be fixed now.
Comment 5 EWS 2021-04-08 15:54:27 PDT
Committed r275685 (236319@main): <https://commits.webkit.org/236319@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 425537 [details].
Comment 6 Kimmo Kinnunen 2021-04-09 03:27:08 PDT
Comment on attachment 425537 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=425537&action=review

> Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/DisplayMtl.mm:432
> +    outExtensions->powerPreference = true;

This is not really correct, I don't think the implementation supports the methods defined in the extension..