Bug 233965

Summary: REGRESSION(r286603) [GTK][WPE] WebGL broken after the ANGLE update.
Product: WebKit Reporter: Arcady Goldmints-Orlov <crzwdjk>
Component: ANGLEAssignee: Lauro Moura <lmoura>
Status: RESOLVED FIXED    
Severity: Critical CC: aperez, bugs-noreply, dino, ews-watchlist, kbr, kkinnunen, kondapallykalyan, lmoura, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   
See Also: https://bugs.webkit.org/show_bug.cgi?id=220896
Attachments:
Description Flags
Crash log from debug build
none
Patch none

Description Arcady Goldmints-Orlov 2021-12-07 18:44:18 PST
Changelist r286603, which updated ANGLE to a more recent version, seems to have broken WebGL entirely on both GTK and WPE platforms.
Comment 1 Lauro Moura 2021-12-07 19:41:57 PST
Created attachment 446280 [details]
Crash log from debug build

Running a debug build, the test crashes with the following message (full log attached):

STDERR: FATAL: UnfoldShortCircuitAST.h:26 (UnfoldShortCircuitAST):      ! Unreachable reached: UnfoldShortCircuitAST(/app/webkit/Source/ThirdParty/ANGLE/src/compiler/translator/tree_ops/apple/UnfoldShortCircuitAST.h:26)
STDERR: (ProcessSwapping) Removing process with pid 51 from the origin cache set
STDERR: UNIMPLEMENTED: 
STDERR: /app/webkit/Source/WebKit/UIProcess/API/wpe/PageClientImpl.cpp(371) : virtual void WebKit::PageClientImpl::closeFullScreenManager()
STDERR: WPEWebProcess terminated (pid 51) because the process crashed
STDERR: LEAK: 1 WebPageProxy⏎
Comment 2 Kimmo Kinnunen 2021-12-08 01:30:10 PST
Could you specify if it's the OpenGL backends, where the ANGLE is used only as a shader translator, or ANGLE backends, where it's used for real?
Comment 3 Lauro Moura 2021-12-08 02:39:01 PST
(In reply to Kimmo Kinnunen from comment #2)
> Could you specify if it's the OpenGL backends, where the ANGLE is used only
> as a shader translator, or ANGLE backends, where it's used for real?

The former, WebKitGTK and WPE use the OpenGL backend. We're still working on the full ANGLE support.
Comment 4 Lauro Moura 2021-12-08 05:53:07 PST
I'm did some tests in the WPE/GTK cmake build defining ANGLE_ENABLE_APPLE_WORKAROUNDS and compiling the apple translator sources. Is this a sensible approach?

Results with WPE:

=> Results: 623/654 tests passed (95.3%)

=> Tests to be fixed (6300):
      1 crashes                  ( 0.0%)
      9 timeouts                 ( 0.1%)

=> Tests that will only be fixed if they crash (WONTFIX) (0):


Expected to fail, but passed: (1)
  webgl/1.0.x/conformance/extensions/oes-vertex-array-object.html


Regressions: Unexpected text-only failures (3)
  webgl/1.0.3/conformance/extensions/webgl-compressed-texture-s3tc.html [ Failure ]
  webgl/1.0.3/conformance/glsl/misc/shaders-with-name-conflicts.html [ Failure ]
  webgl/1.0.3/conformance/textures/tex-image-and-sub-image-2d-with-video.html [ Failure ]

Regressions: Unexpected timeouts (2)
  webgl/1.0.3/conformance/context/context-eviction-with-garbage-collection.html [ Timeout ]
  webgl/1.0.3/conformance/glsl/misc/expression-list-in-declarator-initializer.html [ Timeout ]
Comment 5 Kimmo Kinnunen 2021-12-08 06:02:41 PST
I think you should remove the use of SH_UNFOLD_SHORT_CIRCUIT.
Comment 6 Lauro Moura 2021-12-08 06:38:33 PST
(In reply to Kimmo Kinnunen from comment #5)
> I think you should remove the use of SH_UNFOLD_SHORT_CIRCUIT.

Seems to have worked like a charm, thanks!

Doing a few more tests with both ports before submitting.
Comment 7 Lauro Moura 2021-12-08 06:57:43 PST
Created attachment 446359 [details]
Patch
Comment 8 EWS 2021-12-08 07:33:20 PST
Committed r286653 (?): <https://commits.webkit.org/r286653>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 446359 [details].
Comment 9 Radar WebKit Bug Importer 2021-12-08 07:34:25 PST
<rdar://problem/86210561>