diff --git a/sample/a-buffer/main.ts b/sample/a-buffer/main.ts index eba8513f..dffb5b3d 100644 --- a/sample/a-buffer/main.ts +++ b/sample/a-buffer/main.ts @@ -567,13 +567,7 @@ const configure = () => { for (let slice = 0; slice < numSlices; ++slice) { // initialize the heads buffer - commandEncoder.copyBufferToBuffer( - headsInitBuffer, - 0, - headsBuffer, - 0, - headsInitBuffer.size - ); + commandEncoder.copyBufferToBuffer(headsInitBuffer, headsBuffer); const scissorX = 0; const scissorY = slice * sliceHeight; diff --git a/sample/bitonicSort/main.ts b/sample/bitonicSort/main.ts index e3525469..5373d548 100644 --- a/sample/bitonicSort/main.ts +++ b/sample/bitonicSort/main.ts @@ -756,10 +756,7 @@ SampleInitFactoryWebGPU( ); commandEncoder.copyBufferToBuffer( timestampQueryResolveBuffer, - 0, - timestampQueryResultBuffer, - 0, - 2 * BigInt64Array.BYTES_PER_ELEMENT + timestampQueryResultBuffer ); } settings['Step Index'] = settings['Step Index'] + 1; @@ -803,18 +800,11 @@ SampleInitFactoryWebGPU( // Copy GPU accessible buffers to CPU accessible buffers commandEncoder.copyBufferToBuffer( elementsOutputBuffer, - 0, - elementsStagingBuffer, - 0, - elementsBufferSize + elementsStagingBuffer ); - commandEncoder.copyBufferToBuffer( atomicSwapsOutputBuffer, - 0, - atomicSwapsStagingBuffer, - 0, - Uint32Array.BYTES_PER_ELEMENT + atomicSwapsStagingBuffer ); } device.queue.submit([commandEncoder.finish()]); diff --git a/sample/computeBoids/main.ts b/sample/computeBoids/main.ts index f74b2a84..088f88d4 100644 --- a/sample/computeBoids/main.ts +++ b/sample/computeBoids/main.ts @@ -289,13 +289,7 @@ function frame() { usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ, }); commandEncoder.resolveQuerySet(querySet, 0, 4, resolveBuffer, 0); - commandEncoder.copyBufferToBuffer( - resolveBuffer, - 0, - resultBuffer, - 0, - resultBuffer.size - ); + commandEncoder.copyBufferToBuffer(resolveBuffer, resultBuffer); } device.queue.submit([commandEncoder.finish()]); diff --git a/sample/occlusionQuery/main.ts b/sample/occlusionQuery/main.ts index 5df06ec4..95b19cda 100644 --- a/sample/occlusionQuery/main.ts +++ b/sample/occlusionQuery/main.ts @@ -311,7 +311,7 @@ function render(now: number) { pass.end(); encoder.resolveQuerySet(querySet, 0, objectInfos.length, resolveBuf, 0); if (resultBuf.mapState === 'unmapped') { - encoder.copyBufferToBuffer(resolveBuf, 0, resultBuf, 0, resultBuf.size); + encoder.copyBufferToBuffer(resolveBuf, resultBuf); } device.queue.submit([encoder.finish()]); diff --git a/sample/timestampQuery/TimestampQueryManager.ts b/sample/timestampQuery/TimestampQueryManager.ts index 86f4a322..9e281b55 100644 --- a/sample/timestampQuery/TimestampQueryManager.ts +++ b/sample/timestampQuery/TimestampQueryManager.ts @@ -77,10 +77,7 @@ export default class TimestampQueryManager { // Copy values to the mappable buffer commandEncoder.copyBufferToBuffer( this.#timestampBuffer, - 0, - this.#timestampMapBuffer, - 0, - this.#timestampBuffer.size + this.#timestampMapBuffer ); } } diff --git a/sample/workloadSimulator/index.html b/sample/workloadSimulator/index.html index ce8933bc..65da1fe7 100644 --- a/sample/workloadSimulator/index.html +++ b/sample/workloadSimulator/index.html @@ -778,7 +778,7 @@

Web graphics workload simulator

new Float32Array(buffer.getMappedRange()).set(mapAsyncArray); buffer.unmap(); const commandEncoder = device.createCommandEncoder(); - commandEncoder.copyBufferToBuffer(buffer, 0, mapAsyncTargetBuffer, 0, mapAsyncArray.byteLength); + commandEncoder.copyBufferToBuffer(buffer, mapAsyncTargetBuffer); // TODO: combine this submit with the main one, but we'll have to delay calling mapAsync until after the submit. device.queue.submit([commandEncoder.finish()]); // TODO: use this data during rendering.