afterUpdate() {
    // Disable pointer events on the onscreen canvas when in an immersive XR session
    this._togglePointerListeners(!this._isImmersive())

    super.afterUpdate()

    const {xrSession, _threeRenderer:renderer} = this

    const prevXrSession = _xrSessions.get(this)
    if (xrSession !== prevXrSession) {
      _xrSessions.set(this, xrSession)
      this.renderingScheduler = xrSession || window
      setAnimationScheduler(xrSession || window)
      if (xrSession) {
        let baseLayer = xrSession.renderState.baseLayer
        const gl = renderer.getContext()

        // If the session has an existing valid XRWebGLLayer, just grab its framebuffer.
        // Otherwise, create a new XRWebGLLayer
        if (baseLayer && baseLayer._glContext === gl) {
          bindFramebuffer(renderer, baseLayer.framebuffer)
        } else {
          const promise = gl.makeXRCompatible ? gl.makeXRCompatible() : Promise.resolve() //not always implemented?
          promise.then(() => {
            if (this.xrSession === xrSession) {
              baseLayer = new XRWebGLLayer(xrSession, gl, {
                antialias: !!renderer.getContextAttributes().antialias,
                framebufferScaleFactor: parseFramebufferScaleFactor(this.xrFramebufferScaleFactor, xrSession)
              })
              baseLayer._glContext = gl
              xrSession.updateRenderState({ baseLayer })
              bindFramebuffer(renderer, baseLayer.framebuffer)
              this._queueRender()
            }
          })
        }
      } else {
        bindFramebuffer(renderer, null)
        renderer.setRenderTarget(renderer.getRenderTarget()) //see https://github.com/mrdoob/three.js/pull/15830
        // reset canvas/viewport size in case something changed it (cough cough polyfill)
        renderer.getSize(tempVec2)
        renderer.setDrawingBufferSize(tempVec2.x, tempVec2.y, renderer.getPixelRatio())
        this._queueRender()
      }
    }
  }
Relevant things passed in from XRAware:
@property {XRSession} xrSession
@property {XRSessionMode} xrSessionMode
@property {XRReferenceSpace} xrReferenceSpace
@property {XRReferenceSpaceType} xrReferenceSpaceType
@property {number|string} xrFramebufferScaleFactor

New global event types:
`xrframe` - fired on each frame, with the current time and XRFrame object as arguments