@@ -606,22 +606,10 @@ class WebGLBackend extends Backend {
606606
607607 gl . blitFramebuffer ( x , viewY , x + width , viewY + height , x , viewY , x + width , viewY + height , mask , gl . NEAREST ) ;
608608
609- if ( this . _supportsInvalidateFramebuffer === true ) {
610-
611- gl . invalidateSubFramebuffer ( gl . READ_FRAMEBUFFER , renderTargetContextData . invalidationArray , x , viewY , width , height ) ;
612-
613- }
614-
615609 } else {
616610
617611 gl . blitFramebuffer ( 0 , 0 , renderContext . width , renderContext . height , 0 , 0 , renderContext . width , renderContext . height , mask , gl . NEAREST ) ;
618612
619- if ( this . _supportsInvalidateFramebuffer === true ) {
620-
621- gl . invalidateFramebuffer ( gl . READ_FRAMEBUFFER , renderTargetContextData . invalidationArray ) ;
622-
623- }
624-
625613 }
626614
627615 }
@@ -641,6 +629,12 @@ class WebGLBackend extends Backend {
641629
642630 }
643631
632+ if ( this . _supportsInvalidateFramebuffer === true ) {
633+
634+ gl . invalidateFramebuffer ( gl . READ_FRAMEBUFFER , renderTargetContextData . invalidationArray ) ;
635+
636+ }
637+
644638 } else if ( renderTarget . resolveDepthBuffer === false && renderTargetContextData . framebuffers ) {
645639
646640 const fb = renderTargetContextData . framebuffers [ renderContext . getCacheKey ( ) ] ;
@@ -2288,13 +2282,6 @@ class WebGLBackend extends Backend {
22882282
22892283 invalidationArray . push ( gl . COLOR_ATTACHMENT0 + i ) ;
22902284
2291- if ( depthBuffer ) {
2292-
2293- const depthStyle = stencilBuffer ? gl . DEPTH_STENCIL_ATTACHMENT : gl . DEPTH_ATTACHMENT ;
2294- invalidationArray . push ( depthStyle ) ;
2295-
2296- }
2297-
22982285 const texture = descriptor . textures [ i ] ;
22992286 const textureData = this . get ( texture ) ;
23002287
@@ -2309,7 +2296,7 @@ class WebGLBackend extends Backend {
23092296 renderTargetContextData . msaaFrameBuffer = msaaFb ;
23102297 renderTargetContextData . msaaRenderbuffers = msaaRenderbuffers ;
23112298
2312- if ( depthRenderbuffer === undefined ) {
2299+ if ( depthBuffer && depthRenderbuffer === undefined ) {
23132300
23142301 depthRenderbuffer = gl . createRenderbuffer ( ) ;
23152302 this . textureUtils . setupRenderBufferStorage ( depthRenderbuffer , descriptor , samples ) ;
0 commit comments