mirror of
https://github.com/photonstorm/phaser
synced 2025-02-16 14:08:28 +00:00
Fix WebGLShader recovery from WebGL context loss.
This commit is contained in:
parent
6f36e8201d
commit
4fd8fc94c3
1 changed files with 12 additions and 1 deletions
|
@ -1206,6 +1206,7 @@ var WebGLPipeline = new Class({
|
|||
restoreContext: function ()
|
||||
{
|
||||
var shaders = this.shaders;
|
||||
var hasVertexBuffer = !!this.vertexBuffer;
|
||||
|
||||
// Deactivate all invalidated state.
|
||||
this.activeBuffer = null;
|
||||
|
@ -1215,9 +1216,19 @@ var WebGLPipeline = new Class({
|
|||
this.currentTexture = null;
|
||||
this.currentUnit = 0;
|
||||
|
||||
if (hasVertexBuffer)
|
||||
{
|
||||
this.setVertexBuffer();
|
||||
}
|
||||
|
||||
for (var i = 0; i < shaders.length; i++)
|
||||
{
|
||||
shaders[i].syncUniforms();
|
||||
var shader = shaders[i];
|
||||
shader.syncUniforms();
|
||||
if (hasVertexBuffer)
|
||||
{
|
||||
shader.rebind();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue