From 2fc5c966c592b9e36ffd9a5177c618230661b4a5 Mon Sep 17 00:00:00 2001 From: Madison Rickert <3495636+madisonrickert@users.noreply.github.com> Date: Thu, 2 Apr 2026 16:50:38 -0700 Subject: [PATCH] fix: dispose variable ShaderMaterials in GPUComputationRenderer.dispose() ShaderMaterials created by createShaderMaterial() for each variable are stored in variable.material but never disposed. The existing quad.dispose() call disposes the passThruShader via the mesh, but the per-variable materials and their WebGL programs are never released. Same fix submitted to three-stdlib: https://github.com/pmndrs/three-stdlib/pull/428 Co-Authored-By: Claude Opus 4.6 (1M context) --- examples/jsm/misc/GPUComputationRenderer.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/jsm/misc/GPUComputationRenderer.js b/examples/jsm/misc/GPUComputationRenderer.js index 94ec75aca7f8c2..daaee9eb378d7a 100644 --- a/examples/jsm/misc/GPUComputationRenderer.js +++ b/examples/jsm/misc/GPUComputationRenderer.js @@ -339,6 +339,8 @@ class GPUComputationRenderer { } + variable.material.dispose(); + } };