phaser-ce icon indicating copy to clipboard operation
phaser-ce copied to clipboard

Firefox Mobile error: WebGL warning: vertexAttribPointer: -1 is not a valid index

Open Zykino opened this issue 8 years ago • 7 comments

  • A bug in the API:
    • Phaser version(s): v2.8.4
    • Live example: Memory done following phaserjs.com's tutorial
    • What should happen: Phaser should select CANVAS since it is in auto when I try it under Firefox Mobile 55 (Android 7.1.1)
    • What happens instead: I see the Game view, but nothing happen when I click to pass the title screen. On the console I have the following: Phaser CE v2.8.4 | Pixi.js | WebGL | WebAudio " http://phaser.io "♥♥♥ Error: WebGL warning: vertexAttribPointer: -1 is not a valid index. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program. ...
  • A problem with my own code (maybe)

I think it really is a bug in PIXI.js OR Firefox Mobile but since I know none of them...

Be nice. We do this for free. <3

Zykino avatar Aug 28 '17 21:08 Zykino

If Firefox Mobile supports WebGL then Phaser will use it (for AUTO). You can try CANVAS instead and see what happens.

samme avatar Aug 28 '17 21:08 samme

Please view filters/bacteria and see if it runs and if you get the WebGL warning in the console.

If you get the warning, please expand the trace and note it.

samme avatar Aug 29 '17 17:08 samme

Animation is working but in the console I got:

loadPath ../  example.js:6:3
scale.boot() scaleMode 2  example.js:21:5
   Phaser CE v2.8.4 | Pixi.js | WebGL | WebAudio    " http://phaser.io "♥♥♥  phaser.js:35035:13
load.reset() load.path ../  example.js:15:5
Error: WebGL warning: Exceeded 2 live WebGL contexts for this principal, losing the least recently used one.  phaser.js:17190:14
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:18818:9
load.reset() load.path ../  example.js:15:5
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:18818:9
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:19813:5
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:18818:9
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:19813:5
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:18818:9
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:19813:5
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:18818:9
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:19813:5
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:18818:9
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:19813:5
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:18818:9
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:19813:5
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:18818:9
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:19813:5
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:18818:9
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:19813:5
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:18818:9
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:19813:5
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:18818:9
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:19813:5
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:18818:9
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:19813:5
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:18818:9
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:19813:5
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:18818:9
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:19813:5
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:18818:9
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:19813:5
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:18818:9
Error: WebGL warning: vertexAttribPointer: -1 is not a valid `index`. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program.  phaser.js:19813:5
Error: WebGL: No further warnings will be reported for this WebGL context. (already reported 32 warnings)  phaser.js:19813:5

Zykino avatar Aug 29 '17 20:08 Zykino

If the animation is still running it seems the WebGL error isn't fatal.

samme avatar Aug 29 '17 20:08 samme

Yep at first I thought it was the error blocking my game from working but in fact not.

Still seeing Error messages in the console (even non blocking ones) is concerning. I don't have those when I activate the "Ask the desktop page" option.

For the sake of checking when going on the page https://get.webgl.org/ I don't have anyting about WebGL. Only this: using requestAnimationFrame tdl-minified.js:28:213

The same error is repeated on 2 different lines: phaser.js:18818:9 inside:

PIXI.WebGLSpriteBatch.prototype.flush = function () {
...
gl.vertexAttribPointer(shader.aTextureIndex, 1, gl.FLOAT, false, stride, 20);

phaser.js:19813:5 inside:

PIXI.WebGLFilterManager.prototype.applyFilterPass = function(filter, filterArea, width, height)
...
gl.vertexAttribPointer(shader.aTextureCoord, 2, gl.FLOAT, false, 0, 0);

Don't think I could help you more on this one. Tell me if I should report it to PIXI or to Firefox.

Zykino avatar Aug 30 '17 23:08 Zykino

It's likely a Phaser issue but it's hard to debug.

You can try

game.camera.fx.kill();
game.debug.sprite.kill();

to see if it makes any difference.

samme avatar Aug 31 '17 00:08 samme

Same error but the evening (both with and without your code) I only see the error on line 18818: Error: WebGL warning: vertexAttribPointer: -1 is not a valid index. This value probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program. phaser-test.js:18818:9 32 times

Just to be sure my code look like this:

window.addEventListener("load", function () {
	let game = new Phaser.Game(500, 500);
	game.camera.fx.kill();
	game.debug.sprite.kill();
	[...]
}

Zykino avatar Aug 31 '17 19:08 Zykino