Appearance
2026-02-28 fix: Pixi WebGPU snapshot roomInfo white screen
Background
After upgrading pixi.js to 8.16.0, the WebGPU rendering flow started failing in one specific sequence: call snapshotByData, then render room information in the main instance.
This record captures the reproduction path, root cause, fix, and regression checklist so future Pixi upgrades are easier to verify.
Symptom
In the demo, run this sequence:
- Render either Raster Map or Structured Map.
- Click Snapshot Other Map (this triggers
snapshotByData). - Click Draw roomInfo.
The map turns white and the console reports:
BindGroupSystem._createBindGroupCannot read properties of null (reading '0'/'2')
Root cause
The issue is in Pixi BindGroup.setResource(resource, index).
When replacing a resource, the old logic incorrectly called off('change') on the new resource instead of the previous resource (currentResource). Because of this, stale listeners can survive on the old resource. After the old resource is destroyed, it can still trigger the current BindGroup callback and null out resources[i], which later crashes WebGPU bind group creation.
Fix
The project patch updates both CJS and ESM files:
node_modules/pixi.js/lib/rendering/renderers/gpu/shader/BindGroup.jsnode_modules/pixi.js/lib/rendering/renderers/gpu/shader/BindGroup.mjs
Key change:
diff
- resource.off?.("change", this.onResourceChange, this)
+ currentResource.off?.("change", this.onResourceChange, this)Patch location:
patches/pixi.js+8.16.0.patch
Risk assessment
This is a low-intrusion lifecycle fix. It only changes listener cleanup in the resource replacement path. It does not change rendering strategy or public business APIs.
Regression checklist
Run these checks after each Pixi upgrade or patch refresh:
- Raster -> Snapshot Other Map -> Draw roomInfo.
- Structured -> Snapshot Other Map -> Draw roomInfo.
- Repeat snapshot multiple times, then toggle
showRoomProperty. - Run one core flow on both WebGPU and WebGL.
Related changes
package.json: upgradepixi.jsto8.16.0yarn.lock: lockfile updatepatches/pixi.js+8.16.0.patch: new versioned patch (includes this fix)