From 0d6c401c8b674a5f327505982ba985d88248ff9a Mon Sep 17 00:00:00 2001 From: nianxingyan Date: Mon, 5 Aug 2024 11:46:32 +0800 Subject: [PATCH] fix textures are not uploaded to Context when reused by a disposed RenderTarget --- src/renderers/webgl/WebGLTextures.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/renderers/webgl/WebGLTextures.js b/src/renderers/webgl/WebGLTextures.js index 3e3eb0a1a2fecb..74c03108c3aa3b 100644 --- a/src/renderers/webgl/WebGLTextures.js +++ b/src/renderers/webgl/WebGLTextures.js @@ -262,6 +262,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, if ( textureProperties.__webglInit === undefined ) return; _gl.deleteTexture( textureProperties.__webglTexture ); + delete textureProperties.__webglTexture; properties.remove( texture ); @@ -279,6 +280,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, if ( textureProperties.__webglTexture !== undefined ) { _gl.deleteTexture( textureProperties.__webglTexture ); + delete textureProperties.__webglTexture; info.memory.textures --;