RESOLVED FIXED 236030
ANGLE Metal and ANGLE OpenGL cannot be initialised one after the other
https://bugs.webkit.org/show_bug.cgi?id=236030
Summary ANGLE Metal and ANGLE OpenGL cannot be initialised one after the other
Kimmo Kinnunen
Reported 2022-02-02 10:50:05 PST
ANGLE Metal and ANGLE OpenGL cannot be initialised one after the other This is especially problematic for A8 class SOCs, where we cannot use Metal for WebGL2.
Attachments
Patch (9.52 KB, patch)
2022-02-03 01:36 PST, Kimmo Kinnunen
no flags
Patch (9.52 KB, patch)
2022-02-03 03:16 PST, Kimmo Kinnunen
no flags
Radar WebKit Bug Importer
Comment 1 2022-02-02 11:53:01 PST
Kenneth Russell
Comment 2 2022-02-02 13:10:25 PST
Is this a recent regression in ANGLE compared to the state of things in Bug 228904?
Jonah RD
Comment 3 2022-02-02 14:05:35 PST
Can you provide some more details? Does this mean initializing two ANGLE displays, one after the other, with different backends? Does it work in either order?
Kimmo Kinnunen
Comment 4 2022-02-03 01:36:26 PST
Kimmo Kinnunen
Comment 5 2022-02-03 03:16:19 PST
Kimmo Kinnunen
Comment 6 2022-02-03 13:01:41 PST
(In reply to Jonah RD from comment #3) > Can you provide some more details? > Does this mean initializing two ANGLE displays, one after the other, with > different backends? Does it work in either order? Initializing first WebGL1 with Metal. Then trying to initialize WebGL2 with OpenGL. The backend is a property of EGLDisplay ANGLE does not differentiate EGLDisplays per backend. Only per "power preference". Hence if we have initialised EGL_DEFAULT_DISPLAY with Metal, it will stay initialised as Metal, even if we ask OpenGL.
Kimmo Kinnunen
Comment 7 2022-02-03 13:03:47 PST
> Does it work in either order? No. Ask Metal -> Get Metal Ask OpenGL -> Get Metal Ask OpenGL -> Get OpenGL Ask Metal -> Get OpenGL The only difference is that A8 doesn't support WebGL2 with Metal. So those fail if WebGL1 is asked first.
EWS
Comment 8 2022-02-03 13:08:02 PST
Committed r289071 (246777@main): <https://commits.webkit.org/246777@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 450755 [details].
Kenneth Russell
Comment 9 2022-02-03 18:41:04 PST
Comment on attachment 450755 [details] Patch I don't understand all the implications of this patch. Will it prevent dual-GPU MacBook Pros from using the discrete GPU? Are ANGLE changes needed / desired to make switching between the Metal and OpenGL backends more seamless?
Kimmo Kinnunen
Comment 10 2022-02-04 01:00:03 PST
(In reply to Kenneth Russell from comment #9) > Comment on attachment 450755 [details] > Patch > > I don't understand all the implications of this patch. Will it prevent > dual-GPU MacBook Pros from using the discrete GPU? It will not prevent dual-GPU MacBook Pros from using the discrete GPU, as I understand. Previously ANGLE used (NativeDisplay) as the key to store the EGLDisplay. We had to invent new NativeDisplays for power preference contexts, so that we would get power preference specific native displays. You proposed to change the EGL_GetPlatformDisplayEXT semantics. I said the semantics should be to key on all passed in attributes that affect the display behaviour. You proceeded to change the EGL_GetPlatformDisplayEXT implementation to key just on the power preference attribute. This change trusts that ANGLE keys on power preference. This change knows that ANGLE DOES NOT key on OpenGL vs Metal backend. Note: this particular bug would have existed prior to the semantics change, so I'm not saying that the semantics change would have broken anything. It just did not fix all the bugs in this class of bugs. https://chromium-review.googlesource.com/c/angle/angle/+/3231986 >> Geoff > Kimmo Kinnunen > Patchset 6 > Oct 21 > > I can explain this history here and the decision: > Thank you, makes sense. >>I think every parameter is too much to key on, many are small tweaks > I don't think anything passed as the display attributes is optional. I think omitting any of the attributes that WebKit passes causes similar bugs in WebKit that we have with the power preference. > Not saying this patch should block on it.. > Are ANGLE changes needed / desired to make switching between the Metal and > OpenGL backends more seamless? EGL_GetPlatformDisplayEXT should key on all passed in attributes that affect the display behaviour.
Kenneth Russell
Comment 11 2022-02-07 16:36:41 PST
Thanks for the detailed history and reminder. Apologies if I or we didn't quite understand all the implications of earlier changes and decisions.
Jonah RD
Comment 12 2022-02-09 09:34:30 PST
The ANGLE-side fix is ready to be downstreamed: https://chromium-review.googlesource.com/c/angle/angle/+/3440780
Kimmo Kinnunen
Comment 13 2022-03-01 02:09:35 PST
(In reply to Jonah RD from comment #12) > The ANGLE-side fix is ready to be downstreamed: > https://chromium-review.googlesource.com/c/angle/angle/+/3440780 Thanks for spending the time. Bug 236030 is tracking the webkit side work.
Kimmo Kinnunen
Comment 14 2022-03-01 02:09:39 PST
(In reply to Jonah RD from comment #12) > The ANGLE-side fix is ready to be downstreamed: > https://chromium-review.googlesource.com/c/angle/angle/+/3440780 Thanks for spending the time. Bug 236030 is tracking the webkit side work.
Kenneth Russell
Comment 15 2022-03-01 09:47:15 PST
Looks like Bug 237313 tracks it.
Note You need to log in before you can comment on or make changes to this bug.