It is not a problem with WebGPU, it is working in WebGL because of a side effect: the parallel compilation of shaders let some time before the scene is ready, so scene.freezeActiveMeshes(true) is postponed a bit (because this function is using scene.executeWhenReady internally) and for some reason it makes it work.
Honestly, I think it’s a bug in WebGL. In frozen mode, the vertex buffers should not be updated as there’s this bug:
if (!this._instanceDataStorage.isFrozen) {
instancesBuffer!.updateDirectly(instanceStorage.instancesData, 0, instancesCount);
if (this._scene.needsPreviousWorldMatrices && (!this._instanceDataStorage.manualUpdate || this._instanceDataStorage.previousManualUpdate)) {
instancesPreviousBuffer!.updateDirectly(instanceStorage.instancesPreviousData, 0, instancesCount);
}
}
But because of the delay the master mesh is not flagged as frozen.
If you disable parallel shader compilation, it is not working in WebGL neither:
I think we should add a method to perform the updateDirectly calls on the matrix buffer so that the user can update the matrices even in frozen mode.
For this to work, the master mesh must be visible (because it must be an active mesh). If you really don’t want to display it, you can set a material that will hide it (disableColorWrite = true / disableDepthWrite = true).