From 41407673ea3eff9e36238bd3e85f538e1a52043c Mon Sep 17 00:00:00 2001 From: mrdoob Date: Wed, 9 Mar 2022 13:21:18 -0800 Subject: [PATCH] WebGLTexture: Call invalidateFramebuffer() only in Oculus Browser. (#23692) --- src/renderers/webgl/WebGLTextures.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/renderers/webgl/WebGLTextures.js b/src/renderers/webgl/WebGLTextures.js index 5154f05b306e4b..355d27f7bc8f37 100644 --- a/src/renderers/webgl/WebGLTextures.js +++ b/src/renderers/webgl/WebGLTextures.js @@ -11,6 +11,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, const maxTextureSize = capabilities.maxTextureSize; const maxSamples = capabilities.maxSamples; const multisampledRTTExt = extensions.has( 'WEBGL_multisampled_render_to_texture' ) ? extensions.get( 'WEBGL_multisampled_render_to_texture' ) : null; + const supportsInvalidateFramenbuffer = /OculusBrowser/g.test( navigator.userAgent ); const _videoTextures = new WeakMap(); let _canvas; @@ -1714,7 +1715,12 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, } _gl.blitFramebuffer( 0, 0, width, height, 0, 0, width, height, mask, _gl.NEAREST ); - _gl.invalidateFramebuffer( _gl.READ_FRAMEBUFFER, invalidationArray ); + + if ( supportsInvalidateFramenbuffer ) { + + _gl.invalidateFramebuffer( _gl.READ_FRAMEBUFFER, invalidationArray ); + + } state.bindFramebuffer( _gl.READ_FRAMEBUFFER, null ); state.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer );