Skip to content

Commit eaf72e6

Browse files
zonkypopMugen87
andauthored
WebGPUAttributeUtils: Use correct buffer offset for updateRanges. (#30617)
* WebGPU: use correct destination offset for updateRanges * Take into account BYTES_PER_ELEMENT for updateRanges * Update WebGPUAttributeUtils.js --------- Co-authored-by: Michael Herzog <[email protected]>
1 parent 56a1d6d commit eaf72e6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/renderers/webgpu/utils/WebGPUAttributeUtils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,11 @@ class WebGPUAttributeUtils {
202202

203203
}
204204

205+
const bufferOffset = dataOffset * ( isTypedArray ? array.BYTES_PER_ELEMENT : 1 ); // bufferOffset is always in bytes
206+
205207
device.queue.writeBuffer(
206208
buffer,
207-
0,
209+
bufferOffset,
208210
array,
209211
dataOffset,
210212
size

0 commit comments

Comments
 (0)