Skip to content

Renderer: Disallow render target resizing while in XR.#30738

Merged
Mugen87 merged 1 commit into
mrdoob:devfrom
cabanier:overlay
Mar 15, 2025
Merged

Renderer: Disallow render target resizing while in XR.#30738
Mugen87 merged 1 commit into
mrdoob:devfrom
cabanier:overlay

Conversation

@cabanier

Copy link
Copy Markdown
Contributor

When you bring up the browser in overlay while in WebXR on the Quest browser, the example page tries to do a resize.
This messes up the rendertarget because it doesn't expect that its backing can be resized.

I added code to disallow resizing while in XR mode.

This contribution is funded by Meta

@cabanier

Copy link
Copy Markdown
Contributor Author

Should setPixelRatio also be gated?

@github-actions

Copy link
Copy Markdown

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 336.02
78.26
336.02
78.26
+0 B
+0 B
WebGPU 524.9
146.21
524.97
146.22
+66 B
+10 B
WebGPU Nodes 524.37
146.1
524.43
146.12
+66 B
+11 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 465.06
112.14
465.06
112.14
+0 B
+0 B
WebGPU 597.68
162.47
597.75
162.49
+66 B
+13 B
WebGPU Nodes 552.81
151.96
552.87
151.97
+66 B
+12 B

@Mugen87

Mugen87 commented Mar 15, 2025

Copy link
Copy Markdown
Collaborator

Should setPixelRatio also be gated?

I would say no since this method is usually called once when setting up the renderer. Besides, setting the pixel ratio automatically triggers setSize() so if the latter method is gated, everything should be fine.

@Mugen87 Mugen87 added this to the r175 milestone Mar 15, 2025
@Mugen87 Mugen87 merged commit 4abd407 into mrdoob:dev Mar 15, 2025
@Mugen87 Mugen87 changed the title disallow render target resizing while in XR Renderer: Disallow render target resizing while in XR. Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants