Regression: Pooled textures destroyed while still bound to a shader on resize
PixiJS version
8.21.0
Link to minimal reproduction
https://www.pixiplayground.com/#/edit/tXTzJ3yyzsKjC3-jZCpHV
Steps to reproduce
- Open the reproduction and open the console
- Warnings appear on every resize
Three things matter:
- renderer
resolution: 1.25 filter.resolutionabove about1.2(the playground uses1.5). Set it to1and the warnings stop.- both width and height have to change. Changing one does nothing.
The playground resizes between 600x400 and 620x420 every 500ms.
What is expected?
Resizing with a filter on screen should not warn. 8.20.1 does not.
What is actually happening?
Every resize logs:
[BindGroup] a 'textureSource' was destroyed while still bound to a shader. Remove it from the shader before destroying it.
[BindGroup] a 'textureSampler' was destroyed while still bound to a shader. Remove it from the shader before destroying it.resize() re-registers the screen, which runs TexturePool._pruneScreenTextures.
That destroys any bucket that is neither a power of two nor a live screen size,
and _dropTextures destroys them without unbinding, so bind groups still holding
them fire onResourceChange.
With a 200x200 element:
filter.resolution 1.22 -> pooled 256x256 no warnings
filter.resolution 1.25 -> pooled 512x500 warningsAt 1.25 the pool caps the height to the screen (500) instead of rounding to 512. 500 is not a power of two, so the bucket goes on the next resize.
Rendering is fine. The issue is log spam, and it reaches production builds since lib/ doesn't strip warn() — only the prebuilt pixi.min.* does.
System Info
System:
OS: Windows 11 10.0.26200
CPU: (12) x64 AMD Ryzen 5 7600X 6-Core Processor
Memory: 10.06 GB / 31.06 GB
Browsers:
Chrome: 153.0.8010.53Any additional comments?
No response
Source: pixijs/pixijs