提交 04c11963 编写于 作者: F Fernando Serrano

Properly dispose WebGLMultiviewRenderTarget textures and fbos

上级 ce60052f
...@@ -258,6 +258,21 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, ...@@ -258,6 +258,21 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
} }
if ( renderTarget.isWebGLMultiviewRenderTarget ) {
_gl.deleteTexture( renderTargetProperties.__webglColorTexture );
_gl.deleteTexture( renderTargetProperties.__webglDepthStencilTexture );
info.memory.textures -= 2;
for ( var i = 0, il = renderTargetProperties.__webglViewFramebuffers.length; i < il; i ++ ) {
_gl.deleteFramebuffer( renderTargetProperties.__webglViewFramebuffers[ i ] );
}
}
properties.remove( renderTarget.texture ); properties.remove( renderTarget.texture );
properties.remove( renderTarget ); properties.remove( renderTarget );
...@@ -1009,6 +1024,8 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, ...@@ -1009,6 +1024,8 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
var ext = extensions.get( 'OVR_multiview2' ); var ext = extensions.get( 'OVR_multiview2' );
info.memory.textures += 2;
var colorTexture = _gl.createTexture(); var colorTexture = _gl.createTexture();
_gl.bindTexture( _gl.TEXTURE_2D_ARRAY, colorTexture ); _gl.bindTexture( _gl.TEXTURE_2D_ARRAY, colorTexture );
_gl.texParameteri( _gl.TEXTURE_2D_ARRAY, _gl.TEXTURE_MAG_FILTER, _gl.NEAREST ); _gl.texParameteri( _gl.TEXTURE_2D_ARRAY, _gl.TEXTURE_MAG_FILTER, _gl.NEAREST );
...@@ -1243,4 +1260,4 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, ...@@ -1243,4 +1260,4 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
} }
export { WebGLTextures }; export { WebGLTextures };
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册