From 2c7e23f8c27365e9c2bfe09824c4820c100832d3 Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Mon, 10 Jun 2024 19:48:06 -0700 Subject: [PATCH] fix size of writeBuffer --- webgpu/webgpu-optimization-step5-use-buffer-offsets.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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();