| // Copyright 2019 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // https://gpuweb.github.io/gpuweb/ |
| |
| [ |
| Exposed(Window WebGPU, DedicatedWorker WebGPU), |
| SecureContext |
| ] interface GPUQueue { |
| [CallWith=ScriptState] void submit(sequence<GPUCommandBuffer> buffers); |
| |
| [CallWith=ScriptState] Promise<void> onSubmittedWorkDone(); |
| |
| // TODO(crbug.com/1088107): Merge these overloads into one with |
| // [AllowShared] BufferSource (or whatever the upstream spec has), which |
| // would expand this to allow SharedArrayBuffer (can't be implemented now). |
| [CallWith=ScriptState, RaisesException] void writeBuffer( |
| GPUBuffer buffer, |
| GPUSize64 bufferOffset, |
| [AllowShared] ArrayBufferView data, |
| optional GPUSize64 dataElementOffset = 0, |
| optional GPUSize64 dataElementCount); |
| [CallWith=ScriptState, RaisesException] void writeBuffer( |
| GPUBuffer buffer, |
| GPUSize64 bufferOffset, |
| ArrayBuffer data, |
| optional GPUSize64 dataByteOffset = 0, |
| optional GPUSize64 byteSize); |
| |
| [CallWith=ScriptState, RaisesException] void writeTexture( |
| GPUImageCopyTexture destination, |
| [AllowShared] ArrayBufferView data, |
| GPUImageDataLayout dataLayout, |
| GPUExtent3D size); |
| [CallWith=ScriptState, RaisesException] void writeTexture( |
| GPUImageCopyTexture destination, |
| ArrayBuffer data, |
| GPUImageDataLayout dataLayout, |
| GPUExtent3D size); |
| |
| [RaisesException] void copyExternalImageToTexture( |
| GPUImageCopyExternalImage source, |
| GPUImageCopyTextureTagged destination, |
| GPUExtent3D copySize); |
| }; |
| GPUQueue includes GPUObjectBase; |