1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9 #include "nsWrapperCache.h"
10 #include "ObjectModel.h"
11 #include "mozilla/dom/TypedArray.h"
12 #include "mozilla/webgpu/WebGPUTypes.h"
17 class RangeEnforcedUnsignedLongSequenceOrGPUExtent3DDict
;
18 class ArrayBufferViewOrArrayBuffer
;
23 struct GPUCopyExternalImageDestInfo
;
24 struct GPUCopyExternalImageSourceInfo
;
25 struct GPUTexelCopyTextureInfo
;
26 struct GPUTexelCopyBufferLayout
;
27 struct TextureCopyView
;
28 struct TextureDataLayout
;
29 using GPUExtent3D
= RangeEnforcedUnsignedLongSequenceOrGPUExtent3DDict
;
38 class Queue final
: public ObjectBase
, public ChildOf
<Device
> {
40 GPU_DECL_CYCLE_COLLECTION(Queue
)
41 GPU_DECL_JS_WRAP(Queue
)
43 Queue(Device
* const aParent
, WebGPUChild
* aBridge
, RawId aId
);
46 const dom::Sequence
<OwningNonNull
<CommandBuffer
>>& aCommandBuffers
);
48 already_AddRefed
<dom::Promise
> OnSubmittedWorkDone(ErrorResult
& aRv
);
50 void WriteBuffer(const Buffer
& aBuffer
, uint64_t aBufferOffset
,
51 const dom::ArrayBufferViewOrArrayBuffer
& aData
,
52 uint64_t aDataOffset
, const dom::Optional
<uint64_t>& aSize
,
55 void WriteTexture(const dom::GPUTexelCopyTextureInfo
& aDestination
,
56 const dom::ArrayBufferViewOrArrayBuffer
& aData
,
57 const dom::GPUTexelCopyBufferLayout
& aDataLayout
,
58 const dom::GPUExtent3D
& aSize
, ErrorResult
& aRv
);
60 void CopyExternalImageToTexture(
61 const dom::GPUCopyExternalImageSourceInfo
& aSource
,
62 const dom::GPUCopyExternalImageDestInfo
& aDestination
,
63 const dom::GPUExtent3D
& aCopySize
, ErrorResult
& aRv
);
69 RefPtr
<WebGPUChild
> mBridge
;
76 } // namespace mozilla
78 #endif // GPU_Queue_H_