-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
webgl: Ensure all Surfman surfaces are released properly #40736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mrobinson
merged 1 commit into
servo:main
from
mrobinson:ensure-all-webgl-surfman-surfaces-are-released
Nov 19, 2025
Merged
webgl: Ensure all Surfman surfaces are released properly #40736
mrobinson
merged 1 commit into
servo:main
from
mrobinson:ensure-all-webgl-surfman-surfaces-are-released
Nov 19, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This change ensures that all Surfman surfaces used for WebRendering rendering are released in the WebGL thread properly by: - Moving `WebGLThread` shutdown to the renderer. The renderer starts it, so it makes sense that the renderer also shuts it down when it can guarantee that no WebRender painting is currently happening and no images will be in use again. - Delaying WebGL context release until all WebRender operations have finished. This ensures that the `SwapChain` is still available for use in the external image handler. The second point is accomplished by sharing a usage map between the renderer and the `WebGLThread` which tracks whether WebRender is currently rendering a particular context. In addition, once the WebGL external image handler is notified that WebRender has finished rendering, it informs the WebGLThread so that it can released any contexts already marked for deletion. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
mukilan
approved these changes
Nov 19, 2025
|
🔨 Triggering try run (#19500825967) for Linux (WPT) |
|
|
Test results for linux-wpt from try job (#19500825967): Flaky unexpected result (37)
Stable unexpected results that are known to be intermittent (19)
|
|
✨ Try run (#19500825967) succeeded. |
github-merge-queue bot
pushed a commit
that referenced
this pull request
Nov 19, 2025
…#40739) This should prevent comments like this: #40736 (comment) --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change ensures that all Surfman surfaces used for WebRendering
rendering are released in the WebGL thread properly by:
WebGLThreadshutdown to the renderer. The renderer starts it,so it makes sense that the renderer also shuts it down when it can
guarantee that no WebRender painting is currently happening and no
images will be in use again.
finished. This ensures that the
SwapChainis still available for usein the external image handler.
The second point is accomplished by sharing a usage map between the
renderer and the
WebGLThreadwhich tracks whether WebRender iscurrently rendering a particular context. In addition, once the WebGL
external image handler is notified that WebRender has finished
rendering, it informs the WebGLThread so that it can released any
contexts already marked for deletion.
Testing: This fixes very common intermittent crashes when running
/_webgl/conformancelocally. It should reduce the incidence of these flakycrashes on the CI.
Fixes: #40399.
Fixes: #40417.