Skip to content

Commit

Permalink
WebGLTexture: Call invalidateFramebuffer() only in Oculus Browser. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Mar 9, 2022
1 parent f133613 commit 4140767
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/renderers/webgl/WebGLTextures.js
Expand Up @@ -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;
Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit 4140767

Please sign in to comment.