phaserjs / phaserjs/phaser

Memory leak when using preFX in the same scene as a 3.8 Spine object

Open
#6,856 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🐛 3rd Party Lib Bug 🐛 Spine 🗄️Backlog Phaser 4
Dominant language
JavaScript
Stars
40.3k
Forks
7.2k
PR merge metrics
No merged PRs in 30d

Description

Version

  • Phaser Version: 3.80.1
  • Operating system: Windows
  • Browser: All browsers

Description

If you assign preFX to any gameObject in a scene that also contains a 3.8 spine object, something goes wacky in the renderer and starts spewing the same instructions into this.renderer.glAttribLocationWrappers on repeat.
Game performance eventually tanks, as renderer.glAttribLocationWrappers.indexOf() is run multiple times per render cycle.

Example Test Code

Click the text to trigger the bug
https://codepen.io/Bambosh/pen/KKjKdxP

Additional Information

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using the linked CodePen with a preFX-enabled game object and a 3.8 Spine object. Inspect the renderer path that repeatedly updates this.renderer.glAttribLocationWrappers and compare behavior with and without preFX or Spine. Done means the repeated instructions stop accumulating and render performance no longer degrades over time.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
game-dev, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.