@@ -361,7 +361,7 @@ class WebGLBackend extends Backend {
361361
362362 // The multisample_render_to_texture extension doesn't work properly if there
363363 // are midframe flushes and an external depth texture.
364- if ( ( this . extensions . has ( 'WEBGL_multisampled_render_to_texture' ) === true ) && renderTarget . autoAllocateDepthBuffer && ! renderTarget . usesMultiview ) {
364+ if ( ( this . extensions . has ( 'WEBGL_multisampled_render_to_texture' ) === true ) && renderTarget . autoAllocateDepthBuffer && ! renderTarget . usesMultiview ) {
365365
366366 console . warn ( 'THREE.WebGLBackend: Render-to-texture extension was disabled because an external texture was provided' ) ;
367367
@@ -1143,7 +1143,7 @@ class WebGLBackend extends Backend {
11431143
11441144 } ;
11451145
1146- if ( renderObject . camera . isArrayCamera && renderObject . camera . cameras . length > 0 && ! renderObject . camera . isMultiViewCamera ) {
1146+ if ( renderObject . camera . isArrayCamera && renderObject . camera . cameras . length > 0 && ! renderObject . camera . isMultiViewCamera ) {
11471147
11481148 const cameraData = this . get ( renderObject . camera ) ;
11491149 const cameras = renderObject . camera . cameras ;
@@ -2063,7 +2063,7 @@ class WebGLBackend extends Backend {
20632063
20642064 } else {
20652065
2066- if ( hasExternalTextures && this . renderer . xr . usesMultiview ( ) ) {
2066+ if ( this . renderer . xr . usesMultiview ( ) ) {
20672067
20682068 multiviewExt . framebufferTextureMultisampleMultiviewOVR ( gl . FRAMEBUFFER , attachment , textureData . textureGPU , 0 , samples , 0 , 2 ) ;
20692069
@@ -2100,10 +2100,10 @@ class WebGLBackend extends Backend {
21002100 textureData . renderTarget = descriptor . renderTarget ;
21012101 textureData . cacheKey = cacheKey ; // required for copyTextureToTexture()
21022102
2103- if ( hasExternalTextures && this . renderer . xr . usesMultiview ( ) ) {
2103+ if ( this . renderer . xr . usesMultiview ( ) ) {
21042104
21052105 multiviewExt . framebufferTextureMultisampleMultiviewOVR ( gl . FRAMEBUFFER , depthStyle , textureData . textureGPU , 0 , samples , 0 , 2 ) ;
2106-
2106+
21072107 } else if ( hasExternalTextures && useMultisampledRTT ) {
21082108
21092109 multisampledRTTExt . framebufferTexture2DMultisampleEXT ( gl . FRAMEBUFFER , depthStyle , gl . TEXTURE_2D , textureData . textureGPU , 0 , samples ) ;
@@ -2116,7 +2116,6 @@ class WebGLBackend extends Backend {
21162116
21172117 gl . framebufferTextureLayer ( gl . FRAMEBUFFER , depthStyle , textureData . textureGPU , 0 , layer ) ;
21182118
2119-
21202119 } else {
21212120
21222121 gl . framebufferTexture2D ( gl . FRAMEBUFFER , depthStyle , gl . TEXTURE_2D , textureData . textureGPU , 0 ) ;
@@ -2153,7 +2152,7 @@ class WebGLBackend extends Backend {
21532152
21542153 // rebind external XR textures
21552154
2156- if ( isXRRenderTarget && hasExternalTextures ) {
2155+ if ( ( isXRRenderTarget && hasExternalTextures ) || this . renderer . xr . usesMultiview ( ) ) {
21572156
21582157 state . bindFramebuffer ( gl . FRAMEBUFFER , fb ) ;
21592158
@@ -2192,7 +2191,7 @@ class WebGLBackend extends Backend {
21922191 if ( this . renderer . xr . usesMultiview ( ) ) {
21932192
21942193 multiviewExt . framebufferTextureMultisampleMultiviewOVR ( gl . FRAMEBUFFER , depthStyle , textureData . textureGPU , 0 , samples , 0 , 2 ) ;
2195-
2194+
21962195 } else if ( useMultisampledRTT ) {
21972196
21982197 multisampledRTTExt . framebufferTexture2DMultisampleEXT ( gl . FRAMEBUFFER , depthStyle , gl . TEXTURE_2D , textureData . textureGPU , 0 , samples ) ;
@@ -2209,7 +2208,7 @@ class WebGLBackend extends Backend {
22092208
22102209 }
22112210
2212- if ( samples > 0 && useMultisampledRTT === false && ! this . renderer . xr . usesMultiview ) {
2211+ if ( samples > 0 && useMultisampledRTT === false && ! this . renderer . xr . usesMultiview ) {
22132212
22142213 if ( msaaFb === undefined ) {
22152214
0 commit comments