Skip to content

Commit cf0622a

Browse files
committed
Pixi.WebGLSpriteBatch: bind to textureIndex only if it's defined
textureIndex is only defined if MultiTexture is enabled, so WebGL gives some warnings when it isn't, as shader.aTextureIndex is -1.
1 parent 232f857 commit cf0622a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,10 @@ PIXI.WebGLSpriteBatch.prototype.flush = function ()
637637
gl.vertexAttribPointer(shader.colorAttribute, 4, gl.UNSIGNED_BYTE, true, stride, 16);
638638

639639
// Texture index
640-
gl.vertexAttribPointer(shader.aTextureIndex, 1, gl.FLOAT, false, stride, 20);
640+
if (PIXI._enableMultiTextureToggle)
641+
{
642+
gl.vertexAttribPointer(shader.aTextureIndex, 1, gl.FLOAT, false, stride, 20);
643+
}
641644
}
642645

643646
// upload the verts to the buffer

0 commit comments

Comments
 (0)