1// Copyright 2019 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// https://gpuweb.github.io/gpuweb/
6
7[
8    Exposed(Window WebGPU, Worker WebGPU)
9] interface GPUBuffer {
10    [RaisesException] void setSubData(
11        unsigned long long dstOffset,
12        [AllowShared, FlexibleArrayBufferView] ArrayBufferView src,
13        optional unsigned long long srcOffset = 0,
14        optional unsigned long long byteLength = 0);
15    [CallWith=ScriptState, RaisesException] Promise<ArrayBuffer> mapReadAsync();
16    [CallWith=ScriptState, RaisesException] Promise<ArrayBuffer> mapWriteAsync();
17    [CallWith=ScriptState] void unmap();
18    [CallWith=ScriptState] void destroy();
19};
20