Explorar el Código

fix create buffer

sebavan hace 5 años
padre
commit
3bd010d410
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      src/Engines/webgpuEngine.ts

+ 3 - 1
src/Engines/webgpuEngine.ts

@@ -537,7 +537,9 @@ export class WebGPUEngine extends Engine {
         dataBuffer.references = 1;
         dataBuffer.capacity = view.byteLength;
         if (arrBuffer) {
-            new Uint8Array(arrBuffer).set(new Uint8Array(view.buffer));
+            const outputView = new Uint8Array(arrBuffer);
+            const inputView = new Uint8Array(view.buffer, view.byteOffset, view.byteLength);
+            outputView.set(inputView);
             buffer.unmap();
         } else {
             this._setSubData(dataBuffer, 0, view);