# BatchedMesh #setMatrixAt delay with webGPU

**URL:** <https://discourse.threejs.org/t/batchedmesh-setmatrixat-delay-with-webgpu/89108>\
**Category:** Questions\
**Tags:** batchedmesh, webgpu\
**Created:** [January 13, 2026, 2:44pm UTC](https://discourse.threejs.org/t/batchedmesh-setmatrixat-delay-with-webgpu/89108 "2026-01-13T14:44:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emeric\_Beaufays](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/emeric_beaufays/32/15033_2.png) [@Emeric\_Beaufays](https://discourse.threejs.org/u/Emeric_Beaufays)\
**Post date:** [January 13, 2026, 2:44pm UTC](https://discourse.threejs.org/t/batchedmesh-setmatrixat-delay-with-webgpu/89108/1 "2026-01-13T14:44:37Z")

</div>

Using BatchedMesh with webGPU renderer: when setting a per instance matrix via #setMatrixAt, I notice that the matrices aren’t necessarily updated on GPU synchronously. Instances (sometimes) appear at the wrong location for a frame

Is there a specific API to call to ensure that BatchedMesh per instance matrices a synced with GPU?

This may be a bug/improvement so I apologies if this isn’t the right place to post. Since doc for webGPU is not always complete I thought I’d risk asking here first.

note:  
I tried making the instances invisible for a few frames hoping for the buffers to be updated when I make them visible but that doesn’t work. I’m guessing invisible instance matrices aren’t updated..

---

<div class="post-metadata">

**Author:** ![Emeric\_Beaufays](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/emeric_beaufays/32/15033_2.png) [@Emeric\_Beaufays](https://discourse.threejs.org/u/Emeric_Beaufays)\
**Post date:** [January 14, 2026, 3:41pm UTC](https://discourse.threejs.org/t/batchedmesh-setmatrixat-delay-with-webgpu/89108/2 "2026-01-14T15:41:21Z")

</div>

The issue was manually resizing the BatchedMesh vertex and index buffers.

So if anybody encounters this. Pre-alocating the maxInstanceCount, maxVertexCount and maxIndexCount is best.

calling BatchedMesh#setGeometrySize and BatchedMesh#setInstanceCount seems to recreate and re-upload buffers/dataTextures asynchronously and the GPU seems to hold stale references

three.js 0.182.0 (webGPU)
