mirror of
https://github.com/photonstorm/phaser
synced 2024-11-26 14:40:38 +00:00
Fix invalid create and destroy code in Program Wrapper.
There is no `deleteUniformLocation` command. (Thanks, AI hallucinations!)
This commit is contained in:
parent
e57ed463b2
commit
d120e0a4b5
1 changed files with 10 additions and 4 deletions
|
@ -177,6 +177,16 @@ var WebGLProgramWrapper = new Class({
|
|||
return;
|
||||
}
|
||||
|
||||
// Unbind current program before creating a new one.
|
||||
// Otherwise, the old program will stay in use,
|
||||
// and cause errors.
|
||||
if (renderer.glWrapper.state.bindings.program === this)
|
||||
{
|
||||
renderer.glWrapper.updateBindingsProgram({
|
||||
bindings: { program: null }
|
||||
});
|
||||
}
|
||||
|
||||
var program = gl.createProgram();
|
||||
|
||||
this.webGLProgram = program;
|
||||
|
@ -466,10 +476,6 @@ var WebGLProgramWrapper = new Class({
|
|||
}
|
||||
this.glAttributes.length = 0;
|
||||
|
||||
this.glUniforms.each(function (name, uniform)
|
||||
{
|
||||
gl.deleteUniformLocation(uniform.location);
|
||||
});
|
||||
this.glUniforms.clear();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue