Skip to content

WebGPURenderer: Improve Sampler disposal.#33850

Merged
Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev2
Jun 20, 2026
Merged

WebGPURenderer: Improve Sampler disposal.#33850
Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev2

Conversation

@Mugen87

@Mugen87 Mugen87 commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Related issue: #33847

Description

While reviewing #33847, I have noticed the samplers are not correctly cleared when a binding or texture destroy happens. That was already an issue before #33847, btw.

With this new code, the usedTimes field correctly tracks the sampler usage when binding or texture destruction happens.

@github-actions

Copy link
Copy Markdown

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 365.63
86.86
365.63
86.86
+0 B
+0 B
WebGPU 667.1
184.95
667.42
185.02
+326 B
+77 B
WebGPU Nodes 665.14
184.64
665.47
184.71
+326 B
+72 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 507.76
123.44
507.76
123.44
+0 B
+0 B
WebGPU 746.77
201.38
747.09
201.45
+326 B
+73 B
WebGPU Nodes 697.11
188.96
697.44
189.04
+326 B
+74 B

@Mugen87 Mugen87 merged commit ad321f2 into mrdoob:dev Jun 20, 2026
10 checks passed
@Mugen87 Mugen87 added this to the r185 milestone Jun 20, 2026
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.

1 participant