# Updating attributes on BufferGeometry for WebGPU

**URL:** <https://discourse.threejs.org/t/updating-attributes-on-buffergeometry-for-webgpu/82030>\
**Category:** Resources\
**Tags:** geometry\
**Created:** [May 5, 2025, 12:38pm UTC](https://discourse.threejs.org/t/updating-attributes-on-buffergeometry-for-webgpu/82030 "2025-05-05T12:38:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![danrossi](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/danrossi/32/1017_2.png) [@danrossi](https://discourse.threejs.org/u/danrossi)\
**Post date:** [May 5, 2025, 12:38pm UTC](https://discourse.threejs.org/t/updating-attributes-on-buffergeometry-for-webgpu/82030/1 "2025-05-05T12:38:14Z")

</div>

I maintain a MSDF text fork that is updated for WebGPU. And discovered the geometry attributes weren’t updating on text changes. I was resetting buffers on text changes. its ok on WebGLRenderer but not WebGPU / WebGLBackend.

Setting a large enough buffer initially

> <https://github.com/danrossi/three-bmfont-text/blob/dde1a7b801bf7acb2d08ef6f09f4d7b3549fe0bc/src/TextGeometry.js#L20>

Modifying the attribute arrays directly

[https://github.com/danrossi/three-bmfont-text/blob/dde1a7b801bf7acb2d08ef6f09f4d7b3549fe0bc/src/layout/TextLayout.js#L8](https://github.com/danrossi/three-bmfont-text/blob/dde1a7b801bf7acb2d08ef6f09f4d7b3549fe0bc/src/layout/TextLayout.js#L8)  
[https://github.com/danrossi/three-bmfont-text/blob/dde1a7b801bf7acb2d08ef6f09f4d7b3549fe0bc/src/layout/Vertices.js#L66](https://github.com/danrossi/three-bmfont-text/blob/dde1a7b801bf7acb2d08ef6f09f4d7b3549fe0bc/src/layout/Vertices.js#L66)

Then setting the ranges

> <https://github.com/danrossi/three-bmfont-text/blob/dde1a7b801bf7acb2d08ef6f09f4d7b3549fe0bc/src/TextGeometry.js#L38>

> <https://github.com/danrossi/three-bmfont-text/blob/dde1a7b801bf7acb2d08ef6f09f4d7b3549fe0bc/src/TextGeometry.js#L35>

Seems to work thankfully.
