Bug 236487 - WebGL context should use discrete gpu if the context is created when the window is on external monitor, ANGLE Metal backend
Summary: WebGL context should use discrete gpu if the context is created when the wind...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kimmo Kinnunen
URL:
Keywords: InRadar
Depends on: 237313 237522
Blocks: webgl2perfproblem
  Show dependency treegraph
 
Reported: 2022-02-10 23:30 PST by Kimmo Kinnunen
Modified: 2022-03-14 05:46 PDT (History)
14 users (show)

See Also:


Attachments
WIP for monday (28.99 KB, patch)
2022-03-04 06:34 PST, Kimmo Kinnunen
no flags Details | Formatted Diff | Diff
Patch (26.42 KB, patch)
2022-03-08 05:22 PST, Kimmo Kinnunen
no flags Details | Formatted Diff | Diff
Patch for landing (27.64 KB, patch)
2022-03-09 01:19 PST, Kimmo Kinnunen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].