From 1b63a2603a6a6229edb3e56d4bebb60b906ea0a4 Mon Sep 17 00:00:00 2001 From: idrisshah <62067245+idrisshah@users.noreply.github.com> Date: Thu, 18 Jan 2024 15:48:25 -0500 Subject: [PATCH] WebXR: check for null render target (#15) (#17) --- src/renderers/WebGLRenderer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderers/WebGLRenderer.js b/src/renderers/WebGLRenderer.js index 527def8b19561e..86440b05dd69fd 100644 --- a/src/renderers/WebGLRenderer.js +++ b/src/renderers/WebGLRenderer.js @@ -2278,7 +2278,7 @@ class WebGLRenderer { renderTargetProperties.__autoAllocateDepthBuffer = depthTexture === undefined; - if ( ! renderTargetProperties.__autoAllocateDepthBuffer && ! _currentRenderTarget.isWebGLMultiviewRenderTarget ) { + if ( ! renderTargetProperties.__autoAllocateDepthBuffer && ( ! _currentRenderTarget || ! _currentRenderTarget.isWebGLMultiviewRenderTarget ) ) { // The multisample_render_to_texture extension doesn't work properly if there // are midframe flushes and an external depth buffer. Disable use of the extension.