#12251·pixijs

Nested filters crash after renderer resize

Author: karaerenCreated Sep 28, 2026Updated Sep 28, 2026

PixiJS version

8.21.0 (latest)

Link to minimal reproduction

https://www.pixiplayground.com/#/edit/mC7E06TUGRPXgcakQR3ZR

Steps to reproduce

  1. Open the reproduction link and the console.
  2. It creates a rectangle with an AlphaFilter inside a container with another AlphaFilter.
  3. The example renders once, resizes the renderer from 301 × 201 to 347 × 229, then renders again.

What is expected?

Both renders should succeed normally, and the blue rectangle should remain visible after resizing.

What is actually happening?

The first render succeeds.

Resizing produces two warnings about a textureSource and textureSampler being destroyed while still bound to a shader. The second render then crashes:

FilterSystem.ts:783 Uncaught (in promise) TypeError:
Cannot read properties of null (reading '_resolution')

The error occurs in _findFilterResolution. Second render OK is never logged because the render throws first.

System Info

bash
System:
  OS: Windows 11 10.0.26200
  CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor
  Memory: 8.49 GB / 31.92 GB
Browsers:
  Chrome: 153.0.8010.53
  Edge: Chromium (152.0.4191.66)
  Firefox: 156.0.1 - C:\Program Files\Mozilla Firefox\firefox.exe

Any additional comments?

Resizing the renderer seems to prune pooled textures for the old screen size, while the filter stack keeps references to those textures between frames.

I traced the crash to push() incrementing _filterStackIndex before _findFilterResolution() is called. The lookup then starts at _filterStackIndex - 1, which appears to be the current entry rather than the parent. At that point its old texture has already been destroyed and source is null.

I think the lookup during push() needs to start from the parent entry. applyFilter() seems to need slightly different handling since the current entry has already been popped there. I also noticed the lookup excludes index 0, even though that can contain a valid parent filter.