chromium/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.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 GPUCommandEncoder {
    [RaisesException] GPURenderPassEncoder beginRenderPass(GPURenderPassDescriptor descriptor);
    [RaisesException] GPUComputePassEncoder beginComputePass(optional GPUComputePassDescriptor descriptor = {});

    [NoAllocDirectCall] void copyBufferToBuffer(
        GPUBuffer src,
        GPUSize64 srcOffset,
        GPUBuffer dst,
        GPUSize64 dstOffset,
        GPUSize64 size);

    [RaisesException] void copyBufferToTexture(
        GPUImageCopyBuffer source,
        GPUImageCopyTexture destination,
        GPUExtent3D copySize);

    [RaisesException] void copyTextureToBuffer(
        GPUImageCopyTexture source,
        GPUImageCopyBuffer destination,
        GPUExtent3D copySize);

    [RaisesException] void copyTextureToTexture(
        GPUImageCopyTexture source,
        GPUImageCopyTexture destination,
        GPUExtent3D copySize);

    void pushDebugGroup(USVString groupLabel);
    [NoAllocDirectCall] void popDebugGroup();
    void insertDebugMarker(USVString markerLabel);

    [NoAllocDirectCall] void resolveQuerySet(
        GPUQuerySet querySet,
        GPUSize32 firstQuery,
        GPUSize32 queryCount,
        GPUBuffer destination,
        GPUSize64 destinationOffset);

    [RuntimeEnabled=WebGPUExperimentalFeatures, NoAllocDirectCall, RaisesException]
    void writeTimestamp(GPUQuerySet querySet, GPUSize32 queryIndex);

    [NoAllocDirectCall] void clearBuffer(
        GPUBuffer buffer,
        optional GPUSize64 offset = 0,
        optional GPUSize64 size);

    GPUCommandBuffer finish(optional GPUCommandBufferDescriptor descriptor = {});
};
GPUCommandEncoder includes GPUObjectBase;