Bug 236487

Summary: WebGL context should use discrete gpu if the context is created when the window is on external monitor, ANGLE Metal backend
Product: WebKit Reporter: Kimmo Kinnunen <kkinnunen>
Component: WebGLAssignee: Kimmo Kinnunen <kkinnunen>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, changseok, dino, esprehn+autocc, ews-watchlist, geofflang, gman, gyuyoung.kim, jonahr, kbr, kkinnunen, kondapallykalyan, kpiddington, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=237597
Bug Depends on: 237313, 237522    
Bug Blocks: 223434    
Attachments:
Description Flags
WIP for monday
none
Patch
none
Patch for landing none

Description Kimmo Kinnunen 2022-02-10 23:30:39 PST
WebGL context should use discrete gpu if the context is created when the window is on external monitor
Comment 1 Radar WebKit Bug Importer 2022-02-17 23:31:17 PST
<rdar://problem/89131272>
Comment 2 Kimmo Kinnunen 2022-03-04 06:34:16 PST
Created attachment 453837 [details]
WIP for monday
Comment 3 Kimmo Kinnunen 2022-03-08 05:22:47 PST
Created attachment 454109 [details]
Patch
Comment 4 Kenneth Russell 2022-03-08 13:16:20 PST
Adding Kyle and ANGLE folks as FYI.
Comment 5 Kenneth Russell 2022-03-08 13:21:10 PST
Comment on attachment 454109 [details]
Patch

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

Looks great. A couple of small comments, but r+.

> Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm:161
> +            // is anyway already powered on.

Perhaps mention here that this code relies on the assumption that EGL_ANGLE_platform_angle_device_id uses the IOKit registry ID of the GPU on Mac platforms?

> Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm:163
> +                displayAttributes.append(EGL_PLATFORM_ANGLE_DEVICE_ID_HIGH_ANGLE);

Would you like to at least ASSERT the availability of the EGL_ANGLE_platform_angle_device_id EGL client extension somewhere?
Comment 6 Kimmo Kinnunen 2022-03-09 01:19:39 PST
Created attachment 454207 [details]
Patch for landing
Comment 7 EWS 2022-03-14 05:46:47 PDT
Committed r291224 (248379@main): <https://commits.webkit.org/248379@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 454207 [details].