Skip to content

TSL: Fix dispose() when using reflector().#30933

Merged
Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev1
Apr 15, 2025
Merged

TSL: Fix dispose() when using reflector().#30933
Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev1

Conversation

@Mugen87

@Mugen87 Mugen87 commented Apr 15, 2025

Copy link
Copy Markdown
Collaborator

Fixed #30929.

Description

The PR makes sure ReflectorNode.dispose() works as expected.


this.backend.destroySampler( texture );
this.backend.destroyTexture( texture );
if ( this.has( texture ) === true ) {

@Mugen87 Mugen87 Apr 15, 2025

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 is to make sure the following does not break the dispose logic:

renderTarget.dispose();
renderTarget.texture.dispose();

Since calling dispose() on the render target disposes all of its textures, it's important to ensure dispose() directly called on a texture does not trigger redundant operations.

@Mugen87 Mugen87 added this to the r176 milestone Apr 15, 2025
@github-actions

Copy link
Copy Markdown

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 336.49
78.38
336.49
78.38
+0 B
+0 B
WebGPU 544.68
150.82
544.84
150.85
+157 B
+28 B
WebGPU Nodes 544.03
150.66
544.19
150.69
+157 B
+28 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 465.58
112.26
465.58
112.26
+0 B
+0 B
WebGPU 618.38
167.07
618.4
167.08
+20 B
+4 B
WebGPU Nodes 573.25
156.44
573.27
156.45
+20 B
+2 B

@Mugen87 Mugen87 merged commit 173a496 into mrdoob:dev Apr 15, 2025
RuthySheffi pushed a commit to RuthySheffi/three.js that referenced this pull request Jun 5, 2025
RuthySheffi pushed a commit to RuthySheffi/three.js that referenced this pull request Jun 5, 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.

TSL: Can not dispose NodeMaterial correct

1 participant