Переглянути джерело

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 <michael.herzog@human-interactive.org>
ZonkyPop 1 рік тому
батько
коміт
eaf72e68af
1 змінених файлів з 3 додано та 1 видалено
  1. 3 1
      src/renderers/webgpu/utils/WebGPUAttributeUtils.js

+ 3 - 1
src/renderers/webgpu/utils/WebGPUAttributeUtils.js

@@ -202,9 +202,11 @@ class WebGPUAttributeUtils {
 
 
 				}
 				}
 
 
+				const bufferOffset = dataOffset * ( isTypedArray ? array.BYTES_PER_ELEMENT : 1 ); // bufferOffset is always in bytes
+
 				device.queue.writeBuffer(
 				device.queue.writeBuffer(
 					buffer,
 					buffer,
-					0,
+					bufferOffset,
 					array,
 					array,
 					dataOffset,
 					dataOffset,
 					size
 					size

粤ICP备19079148号