Should rebind shaders too

This commit is contained in:
Richard Davey 2020-12-11 12:41:48 +00:00
parent ab1646c2a0
commit 166c333d13

View file

@ -854,14 +854,14 @@ var WebGLPipeline = new Class({
*/ */
rebind: function () rebind: function ()
{ {
var wasBound = this.setVertexBuffer(); this.setVertexBuffer();
var shaders = this.shaders; var shaders = this.shaders;
// Loop in reverse, so the first shader in the array is left as being bound // Loop in reverse, so the first shader in the array is left as being bound
for (var i = shaders.length - 1; i >= 0; i--) for (var i = shaders.length - 1; i >= 0; i--)
{ {
this.currentShader = shaders[i].bind(wasBound); this.currentShader = shaders[i].rebind();
} }
this.emit(Events.REBIND, this.currentShader); this.emit(Events.REBIND, this.currentShader);