chromium/third_party/blink/renderer/modules/webgpu/gpu_queue.idl

// 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, Worker),
    SecureContext
] interface GPUQueue {
    [CallWith=ScriptState] void submit(sequence<GPUCommandBuffer> buffers);

    [CallWith=ScriptState] Promise<undefined> onSubmittedWorkDone();

    [CallWith=ScriptState, RaisesException] void writeBuffer(
        GPUBuffer buffer,
        GPUSize64 bufferOffset,
        [AllowShared, BufferSourceTypeNoSizeLimit] ArrayBufferView data,
        optional GPUSize64 dataElementOffset = 0,
        optional GPUSize64 dataElementCount);
    [CallWith=ScriptState, RaisesException] void writeBuffer(
        GPUBuffer buffer,
        GPUSize64 bufferOffset,
        [AllowShared, BufferSourceTypeNoSizeLimit] ArrayBuffer data,
        optional GPUSize64 dataByteOffset = 0,
        optional GPUSize64 byteSize);

    [CallWith=ScriptState, RaisesException] void writeTexture(
        GPUImageCopyTexture destination,
        [AllowShared, BufferSourceTypeNoSizeLimit] ArrayBufferView data,
        GPUImageDataLayout dataLayout,
        GPUExtent3D size);
    [CallWith=ScriptState, RaisesException] void writeTexture(
        GPUImageCopyTexture destination,
        [AllowShared, BufferSourceTypeNoSizeLimit] ArrayBuffer data,
        GPUImageDataLayout dataLayout,
        GPUExtent3D size);

    [RaisesException] void copyExternalImageToTexture(
        GPUImageCopyExternalImage source,
        GPUImageCopyTextureTagged destination,
        GPUExtent3D copySize);
};
GPUQueue includes GPUObjectBase;