Fix failure to restore compressed textures after WebGL context loss.

This commit is contained in:
Ben Richards 2024-02-23 17:54:26 +13:00
parent 3cd756dbe9
commit 42039a144e
2 changed files with 4 additions and 0 deletions

View file

@ -6,6 +6,7 @@
# Bug Fixes
* Fix failure to restore compressed textures after WebGL context loss.
* Fix a single WebGL error, with no visual side-effects, from occurring while calling `Shader.setRenderToTexture()` after the game has started running. Actually, the root cause was leaving new WebGL textures bound after creation.
## Examples, Documentation, Beta Testing and TypeScript

View file

@ -818,6 +818,9 @@ var WebGLRenderer = new Class({
gl.disable(gl.DEPTH_TEST);
gl.enable(gl.CULL_FACE);
// Re-enable compressed texture formats.
_this.compression = _this.getCompressedTextures();
// Restore wrapped GL objects.
// Order matters, as some wrappers depend on others.
var wrapperCreateResource = function (wrapper)