Skip to content

Renderer: Improve canvas target disposal. - #34969

Merged
Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev2
Oct 12, 2026
Merged

Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev2

Conversation

@Mugen87

@Mugen87 Mugen87 commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

Fixed #34965.

Description

The PR improves the disposal of canvas render targets in WebGPURenderer. This makes sure the color and depth textures for each canvas target go correctly away when canvasTarget.dispose() is called or renderer.dispose() is executed.


geometry.removeEventListener( 'dispose', this.get( geometry ).onDispose );
const geometryData = this.get( geometry );
geometryData.onDispose();

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the leak of the FullScreenQuad geometry. dispose() does not just remove the event listener but actually destroys the geometry now similar to Textures.

@github-actions

Copy link
Copy Markdown

📦 Bundle size

Full ESM build including core, minified and gzipped.

Before After Diff
Core 390.67
102.48
390.67
102.48
+0 B
+0 B
WebGL 777.10
194.06
777.10
194.06
+0 B
+0 B
WebGPU 1091.00
293.94
1091.58
294.03
+578 B
+88 B
WebGPU Nodes 1088.95
293.59
1089.53
293.67
+578 B
+80 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 518.47
124.58
518.47
124.58
+0 B
+0 B
WebGPU 770.38
206.42
770.96
206.50
+578 B
+74 B
WebGPU Nodes 717.50
193.20
718.08
193.28
+578 B
+77 B

@Mugen87 Mugen87 added this to the r187 milestone Oct 12, 2026
@Mugen87
Mugen87 merged commit 0087015 into mrdoob:dev Oct 12, 2026
10 checks passed
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.

WebGPURenderer: dispose() leaves the depth texture and output quad buffer on a user-provided device

1 participant