Bug 263646 - [GTK][WPE] PlatformDisplay should not use EGL_EXTERNAL_CONTEXT_SAVE_STATE_ANGLE
Summary: [GTK][WPE] PlatformDisplay should not use EGL_EXTERNAL_CONTEXT_SAVE_STATE_ANGLE
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Carlos Garcia Campos
URL:
Keywords: InRadar
Depends on:
Blocks: 263639
  Show dependency treegraph
 
Reported: 2023-10-25 04:27 PDT by Kimmo Kinnunen
Modified: 2023-10-26 00:03 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kimmo Kinnunen 2023-10-25 04:27:46 PDT
[GTK][WPE] PlatformDisplay should not use EGL_EXTERNAL_CONTEXT_SAVE_STATE_ANGLE

It is removed in upstream ANGLE commit:
Author: Shahbaz Youssefi <syoussefi@chromium.org>
Date:   Thu Jul 27 10:51:07 2023 -0400

    GL: Remove EGL_EXTERNAL_CONTEXT_SAVE_STATE_ANGLE
    
    Now that Chromium no longer uses it.
    
    Bug: angleproject:5509
    Change-Id: Ibb8d9cdc4d67dad77ca50437423b18d81e838203
    Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4724768
    Reviewed-by: Peng Huang <penghuang@chromium.org>
    Reviewed-by: Geoff Lang <geofflang@chromium.org>
    Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>

This is blocking ANGLE update.


Options to fix:
1. Share the WebGL display buffer with external sharing mechanism
Each platform should have the webgl display buffer backing as such a resource that can be bound to the textures explicitly.
The compositor and WebGL should not share OpenGL contexts, as WebGL is not designed to do that.
The WebKit ANGLE should preferably only be used to run WebGL, not the compositor to prevent this kind of merge blockers.


2. When ANGLE usage beings, call eglAcquireExternalContextANGLE.
When ANGLE usage ends and compositor usage begins, call eglReleaseExternalContextANGLE.



Option 1 is preferred.
Comment 1 Kimmo Kinnunen 2023-10-25 04:35:03 PDT
Note: current implementation with context sharing with WebGL and compositor in general will not work correctly with WebGL. (E.g. the option 2 is broken)

WebGL will abandon resources in certain conditions by design.

This means that all abandoned WebGL resources will be leak through the compositor context.

The correct approach is to keep WebGL contexts and compositor contexts separate and share the resources with the external sharing mechanisms.
Comment 2 Carlos Garcia Campos 2023-10-25 04:46:14 PDT
Pull request: https://github.com/WebKit/WebKit/pull/19530
Comment 3 EWS 2023-10-26 00:02:57 PDT
Committed 269804@main (24ec7c56a453): <https://commits.webkit.org/269804@main>

Reviewed commits have been landed. Closing PR #19530 and removing active labels.
Comment 4 Radar WebKit Bug Importer 2023-10-26 00:03:22 PDT
<rdar://problem/117519080>