Memory Leak when using MobilePipeline and SpinePlugin
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 52/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- javascript
- 領域
- game-dev, performance
調査の方向性
提供された Phaser シーンから始め、glAttribLocationWrappers を確認しながら MobilePipeline と MultiPipeline を比較します。Mobile-vert.js と WebGLRenderer.js、特に createAttribLocation を調べ、その後、Spine と別のゲームオブジェクトがレンダリングされるときに、更新のたびに wrapper のコレクションが増加しなくなっていることを例で確認します。
索引モデルが issue の本文から書いたものです。
説明
Version
- Phaser Version: 3.90
- Operating system: All
- Browser: All Mobile
Description
I have found a memory leak when using the MobilePipeline on webgl renderer. The default MultiPipeline works fine and has no memory leaks.
I happens as soon as you have a spine game object and any other game object. It will cause the render game.renderer.glAttribLocationWrappers to infinitely grow on very update.
Example Test Code
import Phaser from 'phaser';
import { SpinePlugin } from '@esotericsoftware/spine-phaser-v3';
class Example extends Phaser.Scene {
preload() {
this.load.atlas('buttons', 'nine-slice.png', 'nine-slice.json');
this.load.spineJson('spineboy-json', 'spine/spineboy-pro.json');
this.load.spineAtlas('spineboy-atlas', 'spine/spineboy-pma.atlas', false);
}
create() {
// Need to have another game object
var button = this.add.nineslice(400, 300, 'buttons', 'button-bg', 400, 110, 64, 64);
button.setInteractive();
button.on('pointerup', this.onButtonPressed, this);
button.input.cursor = 'pointer';
button.setSize(100, 50);
const spineBoy = this.add.spine(500, 500, 'spineboy-json', 'spineboy-atlas');
spineBoy.animationState.setAnimation(0, 'idle', true);
}
onButtonPressed() {
console.log('button pressed');
}
update() {
console.log('glAttribLocationWrappers', this.game.renderer.glAttribLocationWrappers.length);
}
}
const config = {
type: Phaser.WEBGL,
width: 800,
height: 600,
backgroundColor: '#000000',
parent: 'phaser-example',
scene: Example,
render: {
autoMobilePipeline: false, // Disable mobile pipeline to force default
defaultPipeline: 'MobilePipeline' // Comment this out to use default 'MultiPipeline'
},
plugins: {
scene: [{ key: 'spine.SpinePlugin', plugin: SpinePlugin, mapping: 'spine' }]
}
};
const game = new Phaser.Game(config);
Additional Information
I have the console logging, to see it increase in the Mobile Pipeline and it won't in the default one.
From my investigation. I have found that the Mobile-vert,js shader has an unused attribute inTexId, and it is gettting compiled out and then in the WebGLRenderer.js createAttribLocation function its tries to create the wrapper but it cannot get a location which keeps adding to the glAttriLocationWrappers array and never removes it.
- 主要言語
- JavaScript
- スター
- 40.7k
- フォーク
- 7.2k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
phaserjs/phaser のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 3 日以内に返信
-
Type definition for TilemapLayer.getTileAt is wrong対応中かも @hkbughk が 34 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 3 日以内に返信
-
Shader.preDestroy leaks its ShaderQuad's vertex buffer and VAO on every create/destroy cycle (4.2.1)対応中かも @k1epg01ng129-eng が 32 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 3 日以内に返信
-
Black opaque background on transparent Phaser.Text textures in Phaser 4.2.1 on older iOS WebGL対応中かも @SamuelMalmfors が 14 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
phaserjs/phaser#7392 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
phaserjs/phaser の issue をすべて見る
似ている issue
-
enhancement ready
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
DCGM/semant-demo#708 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
agents area: runtime automation chore cli consistency dependencies developer-experience difficulty: easy documentation enhancement good first issue help wanted hygiene json-output priority: P3 starters tests
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
Client codegen: an import repeated in an impl file is emitted twice, and the browser rejects the module対応中かも @MalithaPrabhashana が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
jaseci-labs/jac#10756 ·
メンテナーはふだん 1 日以内に返信