From b66028ec8ef063fbbc061a6d321311a447ac0ceb Mon Sep 17 00:00:00 2001 From: Ben Richards Date: Fri, 2 Feb 2024 15:53:03 +1300 Subject: [PATCH] Handle more invalidated state on WebGL context restore. --- src/renderer/webgl/WebGLPipeline.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/renderer/webgl/WebGLPipeline.js b/src/renderer/webgl/WebGLPipeline.js index 35fe31b5b..7daef2453 100644 --- a/src/renderer/webgl/WebGLPipeline.js +++ b/src/renderer/webgl/WebGLPipeline.js @@ -1207,6 +1207,14 @@ var WebGLPipeline = new Class({ { var shaders = this.shaders; + // Deactivate all invalidated state. + this.activeBuffer = null; + this.activeTextures.length = 0; + this.batch.length = 0; + this.currentBatch = null; + this.currentTexture = null; + this.currentUnit = 0; + for (var i = 0; i < shaders.length; i++) { shaders[i].syncUniforms();