|
@@ -409,8 +409,7 @@ class WebGLTextureUtils {
|
|
|
|
|
|
|
|
backend.set( texture, {
|
|
backend.set( texture, {
|
|
|
textureGPU,
|
|
textureGPU,
|
|
|
- glTextureType,
|
|
|
|
|
- isDefault: true
|
|
|
|
|
|
|
+ glTextureType
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -741,14 +740,20 @@ class WebGLTextureUtils {
|
|
|
* Destroys the GPU data for the given texture object.
|
|
* Destroys the GPU data for the given texture object.
|
|
|
*
|
|
*
|
|
|
* @param {Texture} texture - The texture.
|
|
* @param {Texture} texture - The texture.
|
|
|
|
|
+ * @param {boolean} [isDefaultTexture=false] - Whether the texture uses a default GPU texture or not.
|
|
|
*/
|
|
*/
|
|
|
- destroyTexture( texture ) {
|
|
|
|
|
|
|
+ destroyTexture( texture, isDefaultTexture = false ) {
|
|
|
|
|
|
|
|
const { gl, backend } = this;
|
|
const { gl, backend } = this;
|
|
|
const { textureGPU, renderTarget } = backend.get( texture );
|
|
const { textureGPU, renderTarget } = backend.get( texture );
|
|
|
|
|
|
|
|
this.deallocateRenderBuffers( renderTarget );
|
|
this.deallocateRenderBuffers( renderTarget );
|
|
|
- gl.deleteTexture( textureGPU );
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if ( isDefaultTexture === false ) {
|
|
|
|
|
+
|
|
|
|
|
+ gl.deleteTexture( textureGPU );
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
backend.delete( texture );
|
|
backend.delete( texture );
|
|
|
|
|
|