diff --git a/webgpu/webgpu-optimization-step5-use-buffer-offsets.html b/webgpu/webgpu-optimization-step5-use-buffer-offsets.html index 513a65ef..c5fcc6df 100644 --- a/webgpu/webgpu-optimization-step5-use-buffer-offsets.html +++ b/webgpu/webgpu-optimization-step5-use-buffer-offsets.html @@ -549,7 +549,7 @@ // upload all uniform values to the uniform buffer if (settings.numObjects) { const size = (settings.numObjects - 1) * uniformBufferSpace + uniformBufferSize; - device.queue.writeBuffer( uniformBuffer, 0, uniformValues, 0, size); + device.queue.writeBuffer( uniformBuffer, 0, uniformValues, 0, size / uniformValues.BYTES_PER_ELEMENT); } pass.end();