How to make a mat4 attribute in WebGPURenderer

Based on WebGLRenderer , I can create a mat4 attribute and pass it to the shader for computations. However, after switching to WebGPURenderer , WebGPU does not support mat4 attributes, and it supports a maximum of 8 vertex buffers. Using four vec4 attributes to simulate a mat4 seems a bit wasteful, and updating this mat4 in WebGPURenderer is also an issue.

  1. What is the best practice for passing a mat4 attribute using WebGPURenderer ? Should it be emulated with four vec4 attributes, or is there another method?
  2. I referred to the handling of instanceMatrix in instanceNode to pass a mat4 like this.
const buffer = new InstancedInterleavedBuffer( instanceAttribute.array, 16, 1 );

this.buffer = buffer;

const bufferFn = instancedBufferAttribute;

const buffers = [
	// F.Signature -> bufferAttribute( array, type, stride, offset )
	bufferFn( buffer, 'vec4', 16, 0 ),
	bufferFn( buffer, 'vec4', 16, 4 ),
	bufferFn( buffer, 'vec4', 16, 8 ),
	bufferFn( buffer, 'vec4', 16, 12 )
];

matrix = mat4( ...buffers ).toVar();
currentMatrix.assign(matrix);

However, when my geometry changes (disposing of the old geometry and creating a new one), the above code causes an error. The above code seems unable to handle geometry changesWhy does this happen?
image