I am using InstancedMesh with WebGpu.
https://threejs.org/examples/?q=instance#webgpu_instance_mesh
Changing InstancedMesh count throws error with WebGPU.
total = 10000;
mesh = new THREE.InstancedMesh( geometry, material,total );
scene.add( mesh );
mesh.count = 100;
Error
Binding size (640000) of [Buffer "bindingBuffer_UniformBuffer_0"] is larger than the maximum binding size (65536).
- While validating entries[1] as a Buffer.
Expected entry layout: {type: BufferBindingType::Uniform, minBindingSize: 0, hasDynamicOffset: 0}
- While validating [BindGroupDescriptor "bindGroup_object"] against [BindGroupLayout (unlabeled)]
- While calling [Device].CreateBindGroup([BindGroupDescriptor "bindGroup_object"]).
This has been answered here
opened 03:49AM - 26 Sep 24 UTC
closed 11:15AM - 26 Sep 24 UTC
WebGPU
### Description
I am using InstancedMesh with WebGpu.
https://threejs.org/ex… amples/?q=instance#webgpu_instance_mesh
Changing InstancedMesh count throws error with WebGPU.
create instance mesh with count of 10000
`mesh = new THREE.InstancedMesh( geometry, material,10000 );`
Then I change the count to less than 1000
`mesh.count = 100;`
**Error**
`Binding size (640000) of [Buffer "bindingBuffer_UniformBuffer_0"] is larger than the maximum binding size (65536).
- While validating entries[1] as a Buffer.
Expected entry layout: {type: BufferBindingType::Uniform, minBindingSize: 0, hasDynamicOffset: 0}
- While validating [BindGroupDescriptor "bindGroup_object"] against [BindGroupLayout (unlabeled)]
- While calling [Device].CreateBindGroup([BindGroupDescriptor "bindGroup_object"]).`
`[Invalid BindGroup "bindGroup_object"] is invalid.
- While encoding [RenderPassEncoder (unlabeled)].SetBindGroup(0, [BindGroup], 0, ...).
- While finishing [CommandEncoder "renderContext_0"].`
`[Invalid CommandBuffer from CommandEncoder "renderContext_0"] is invalid.
- While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_0"]])`
### Reproduction steps
1. Create InstancedMesh with three js `mesh = new THREE.InstancedMesh( geometry, material,10000 );`
2. add InstancedMesh to scene ` scene.add(mesh)`
3. Change the InstancedMesh count to less than 100 `mesh.count = 100;`
### Code
```js
mesh = new THREE.InstancedMesh( geometry, material,10000 );
scene.add(mesh)
mesh.count = 100;
```
### Live example
* [[jsfiddle-latest-release WebGPURenderer](https://jsfiddle.net/GnanaSai/0w4b2L5z/17/)
### Screenshots
![image](https://github.com/user-attachments/assets/43bbd9e3-9402-4270-9c05-77d7efa70761)
### Version
r168
### Device
Desktop
### Browser
Chrome
### OS
Windows