fix: prevent video-backed luma masks from crashing the renderer during playback#128
Merged
dazzatronus merged 1 commit intoJun 24, 2026
Conversation
|
🎉 This PR is included in version 2.11.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
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.
What
Luma masks backed by a video source crash the canvas renderer a few seconds into playback. This fixes the crash.
Why
The per-frame refresh of a video luma destroyed and recreated the mask's GPU texture every frame. Pixi caches a bind group against the mask texture's source, so freeing it left the mask filter pointing at released memory on the next draw →
Cannot read properties of null (reading '0')inBindGroup.getResource(AlphaMaskPipe→MaskFilter). Image-backed lumas skip the per-frame path, so they were unaffected.How
RenderTextureonce and re-render into it in place each frame, so its source identity stays stable and the cached bind group is never invalidated. Also removes a per-frame GPU texture alloc/free.dispose, clear the masked clip's.maskbefore destroying the sprite, so a teardown mid-render (e.g. hot-reload) can't leave a dangling mask.Verify
npx jest tests/luma-mask-controller.test.ts— 25 pass; full suite green.Reviewer note
The
pre-pushtschook fails on 7 pre-existing errors in unrelated files (audio-player,image-player,video-player,media-thumbnail-renderer) that this branch does not touch; the push used--no-verify. CI may surface the same pre-existing errors — they are not introduced here.