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 GPUImageCopyTexture
;
24 struct GPUImageDataLayout
;
25 struct TextureCopyView
;
26 struct TextureDataLayout
;
27 using GPUExtent3D
= RangeEnforcedUnsignedLongSequenceOrGPUExtent3DDict
;
36 class Queue final
: public ObjectBase
, public ChildOf
<Device
> {
38 GPU_DECL_CYCLE_COLLECTION(Queue
)
39 GPU_DECL_JS_WRAP(Queue
)
41 Queue(Device
* const aParent
, WebGPUChild
* aBridge
, RawId aId
);
44 const dom::Sequence
<OwningNonNull
<CommandBuffer
>>& aCommandBuffers
);
46 already_AddRefed
<dom::Promise
> OnSubmittedWorkDone(ErrorResult
& aRv
);
48 void WriteBuffer(const Buffer
& aBuffer
, uint64_t aBufferOffset
,
49 const dom::ArrayBufferViewOrArrayBuffer
& aData
,
50 uint64_t aDataOffset
, const dom::Optional
<uint64_t>& aSize
,
53 void WriteTexture(const dom::GPUImageCopyTexture
& aDestination
,
54 const dom::ArrayBufferViewOrArrayBuffer
& aData
,
55 const dom::GPUImageDataLayout
& aDataLayout
,
56 const dom::GPUExtent3D
& aSize
, ErrorResult
& aRv
);
58 void CopyExternalImageToTexture(
59 const dom::GPUImageCopyExternalImage
& aSource
,
60 const dom::GPUImageCopyTextureTagged
& aDestination
,
61 const dom::GPUExtent3D
& aCopySize
, ErrorResult
& aRv
);
67 RefPtr
<WebGPUChild
> mBridge
;
74 } // namespace mozilla
76 #endif // GPU_Queue_H_