Skip to content

Commit

Permalink
fix size of writeBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Jun 11, 2024
1 parent 175ca20 commit 2c7e23f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion webgpu/webgpu-optimization-step5-use-buffer-offsets.html
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 2c7e23f

Please sign in to comment.