{"version":3,"file":"fastCopy.mjs","sources":["../../../../../../src/rendering/renderers/shared/buffer/utils/fastCopy.ts"],"sourcesContent":["/**\n * Copies from one buffer to another.\n * This is an optimised function that will use `Float64Array` window.\n * This means it can copy twice as fast!\n * @param sourceBuffer - the array buffer to copy from\n * @param destinationBuffer - the array buffer to copy to\n * @private\n */\nexport function fastCopy(sourceBuffer: ArrayBuffer, destinationBuffer: ArrayBuffer): void\n{\n    const lengthDouble = (sourceBuffer.byteLength / 8) | 0;\n\n    const sourceFloat64View = new Float64Array(sourceBuffer, 0, lengthDouble);\n    const destinationFloat64View = new Float64Array(destinationBuffer, 0, lengthDouble);\n\n    // Use set for faster copying\n    destinationFloat64View.set(sourceFloat64View);\n\n    // copying over the remaining bytes\n    const remainingBytes = sourceBuffer.byteLength - (lengthDouble * 8);\n\n    if (remainingBytes > 0)\n    {\n        const sourceUint8View = new Uint8Array(sourceBuffer, lengthDouble * 8, remainingBytes);\n        const destinationUint8View = new Uint8Array(destinationBuffer, lengthDouble * 8, remainingBytes);\n\n        // Direct copy for remaining bytes\n        destinationUint8View.set(sourceUint8View);\n    }\n}\n"],"names":[],"mappings":";AAQgB,SAAA,QAAA,CAAS,cAA2B,iBACpD,EAAA;AACI,EAAM,MAAA,YAAA,GAAgB,YAAa,CAAA,UAAA,GAAa,CAAK,GAAA,CAAA,CAAA;AAErD,EAAA,MAAM,iBAAoB,GAAA,IAAI,YAAa,CAAA,YAAA,EAAc,GAAG,YAAY,CAAA,CAAA;AACxE,EAAA,MAAM,sBAAyB,GAAA,IAAI,YAAa,CAAA,iBAAA,EAAmB,GAAG,YAAY,CAAA,CAAA;AAGlF,EAAA,sBAAA,CAAuB,IAAI,iBAAiB,CAAA,CAAA;AAG5C,EAAM,MAAA,cAAA,GAAiB,YAAa,CAAA,UAAA,GAAc,YAAe,GAAA,CAAA,CAAA;AAEjE,EAAA,IAAI,iBAAiB,CACrB,EAAA;AACI,IAAA,MAAM,kBAAkB,IAAI,UAAA,CAAW,YAAc,EAAA,YAAA,GAAe,GAAG,cAAc,CAAA,CAAA;AACrF,IAAA,MAAM,uBAAuB,IAAI,UAAA,CAAW,iBAAmB,EAAA,YAAA,GAAe,GAAG,cAAc,CAAA,CAAA;AAG/F,IAAA,oBAAA,CAAqB,IAAI,eAAe,CAAA,CAAA;AAAA,GAC5C;AACJ;;;;"}