Browse Source

WebGLTexture: Call invalidateFramebuffer() only in Oculus Browser. (#23692)

mrdoob 3 năm trước cách đây
mục cha
commit
41407673ea
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 7 1
      src/renderers/webgl/WebGLTextures.js

+ 7 - 1
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 );