Hello everyone,
we’ve been using Three.js in our project for about six years now. With the WebGLRenderer, everything worked fine.
Recently, however, we started migrating to WebGPURenderer because we need NodeMaterials for better integration with an external API — and that’s where the problems began.
The first issue I ran into was with the Mesh class.
When creating a mesh like this:
const mesh = new Mesh(someGeometry);
it automatically created a MeshBasicMaterial, even though Mesh was imported from three/webgpu.
Running this produced several warnings and errors in the console.
I worked around it by creating a small helper that assigns a MeshBasicNodeMaterial instead.
Still, it would be nice if Three.js automatically created a proper node material when using WebGPU.
That’s a minor issue, though.
The main problem is that my application crashes after a short time with the following warning:
[Buffer (unlabeled)] used in submit while destroyed.
While calling [Queue].Submit([[CommandBuffer from CommandEncoder “renderContext_22”]])
Question: Can someone explain what’s happening here?
I have a first hint that this might be related to calling .dispose() on some geometries.
I use .dispose() quite often to ensure GPU memory gets cleaned up properly.
At first, I thought the issue occurs when disposing a geometry that is still being used by another mesh in the scene — since this can happen in my app.
To test that theory, I built a small example where you can press “Delete” to dispose the cube’s geometry.
https://codesandbox.io/p/sandbox/magical-nobel-srg565
However, in that simplified example, the error doesn’t appear.
I’ve already implemented my own resource manager that only disposes geometries when no object in the scene is using them anymore.
Interestingly, if I remove the .dispose() calls completely, the app doesn’t crash — but of course, GPU memory (geometry and textures) keeps growing endlessly.
So I’d really like to understand what causes this error.
Maybe someone has an idea, or a minimal example where it can be reproduced, so I can narrow down the root cause.
Thanks in advance for any hints or explanations!