Bug 210222

Summary: Clean up more resources during WebGLLayer teardown
Product: WebKit Reporter: Kenneth Russell <kbr>
Component: WebGLAssignee: Kenneth Russell <kbr>
Status: RESOLVED FIXED    
Severity: Normal CC: dino, ews-watchlist, graouts, justin_fan, kondapallykalyan, ryanhaddad, webkit-bot-watchers-bugzilla, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 210213    
Bug Blocks: 210153    
Attachments:
Description Flags
Patch none

Kenneth Russell
Reported 2020-04-08 15:55:28 PDT
Examining the WebGLLayer cleanup code for the USE(ANGLE) path, it looks like textures can still be bound to IOSurfaces at the time the WebGLLayer is destroyed. Since the OpenGL context (provided via ANGLE) is going to be destroyed, it seems most prudent to unbind those textures if necessary, and delete them, in [WebGLLayer -dealloc].
Attachments
Patch (3.18 KB, patch)
2020-04-13 16:09 PDT, Kenneth Russell
no flags
Kenneth Russell
Comment 1 2020-04-13 16:08:34 PDT
Doing this work in -dealloc: turns out to not be a good idea. It looks like (from Bug 210213) the WebGLLayer is likely retained by the CALayer tree, so its lifetime is much longer than the GraphicsContextGL. There's a specific point just before deletion of the GraphicsContextGL's native context where these resources should be released.
Kenneth Russell
Comment 2 2020-04-13 16:09:47 PDT
EWS
Comment 3 2020-04-13 16:42:52 PDT
Committed r260049: <https://trac.webkit.org/changeset/260049> All reviewed patches have been landed. Closing bug and clearing flags on attachment 396351 [details].
Radar WebKit Bug Importer
Comment 4 2020-04-13 16:43:13 PDT
Kenneth Russell
Comment 5 2020-04-13 17:21:35 PDT
+ryanhaddad@ who found the crashers previously from the fix for Bug 210213 - hope that this patch doesn't cause similar issues. Please revert if it does; thanks.
Ryan Haddad
Comment 6 2020-04-14 09:04:37 PDT
(In reply to Kenneth Russell from comment #5) > +ryanhaddad@ who found the crashers previously from the fix for Bug 210213 - > hope that this patch doesn't cause similar issues. Please revert if it does; > thanks. Thanks for the heads up!
Note You need to log in before you can comment on or make changes to this bug.