Skip to content

Conversation

@sunag
Copy link
Collaborator

@sunag sunag commented Jul 25, 2025

Fixes #31480
Related issue: #28392 (comment), #29183,

Description

The PR simplify the binding generation by removing needsBindingsUpdate() and keep the texture version for update texture data only.
It also fixes the current bug and hopefully addresses a long-standing issue related to texture binding.

@sunag sunag added this to the r179 milestone Jul 25, 2025
@github-actions
Copy link

github-actions bot commented Jul 25, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 338.37
78.9
338.37
78.9
+0 B
+0 B
WebGPU 560.82
155.22
560.67
155.13
-152 B
-88 B
WebGPU Nodes 559.75
155.01
559.59
154.92
-152 B
-88 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 469.75
113.6
469.75
113.6
+0 B
+0 B
WebGPU 635.99
172.12
635.84
172.06
-152 B
-63 B
WebGPU Nodes 590.64
161.36
590.49
161.28
-152 B
-79 B

@gkjohnson
Copy link
Collaborator

Thanks! Is it possible to add something like a setSize function to StorageTexture, as well, similar to RenderTarget? Otherwise I can add it tomorrow after this PR is merged. Something like so:

	setSize( width, height ) {

		if ( this.image.width !== width || this.image.height !== height ) {

			this.image.width = width;
			this.image.height = height;
			this.image.depth = depth;

			this.dispose();

		}

	}

@sunag sunag marked this pull request as ready for review July 25, 2025 14:37
@sunag sunag merged commit 3752bd2 into mrdoob:dev Jul 25, 2025
9 checks passed
@sunag sunag deleted the dev-fix-destroy-texture branch July 25, 2025 14:38
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.

StorageTexture: Cannot be disposed of and reused or resized

3 participants