Skip to content

Commit e7be282

Browse files
obiotclaude
andcommitted
Thread flush parameter through createTexture2D to bindTexture2D
Texture re-uploads (e.g. Text canvas changes) in multi-texture mode no longer force a batch flush. The flush flag is now passed from uploadTexture → createTexture2D → bindTexture2D consistently. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 45d45f5 commit e7be282

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/melonjs/src/video/webgl/batchers/material_batcher.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export class MaterialBatcher extends Batcher {
7777
premultipliedAlpha = true,
7878
mipmap = true,
7979
texture,
80+
flush = true,
8081
) {
8182
const gl = this.gl;
8283
const isPOT = isPowerOfTwo(w) && isPowerOfTwo(h);
@@ -96,7 +97,7 @@ export class MaterialBatcher extends Batcher {
9697
currentTexture = gl.createTexture();
9798
}
9899

99-
this.bindTexture2D(currentTexture, unit);
100+
this.bindTexture2D(currentTexture, unit, flush);
100101

101102
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, rs);
102103
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, rt);
@@ -275,6 +276,7 @@ export class MaterialBatcher extends Batcher {
275276
texture.premultipliedAlpha,
276277
undefined,
277278
texture2D,
279+
flush,
278280
);
279281
} else {
280282
this.bindTexture2D(texture2D, unit, flush);

0 commit comments

Comments
 (0)