Bug 1941128 - Turn off network.dns.native_https_query on Mac again
[gecko.git] / dom / webgpu / Queue.h
blob0e013e517de2fc840447b870a62127c62c0fe737
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/. */
6 #ifndef GPU_Queue_H_
7 #define GPU_Queue_H_
9 #include "nsWrapperCache.h"
10 #include "ObjectModel.h"
11 #include "mozilla/dom/TypedArray.h"
12 #include "mozilla/webgpu/WebGPUTypes.h"
14 namespace mozilla {
15 class ErrorResult;
16 namespace dom {
17 class RangeEnforcedUnsignedLongSequenceOrGPUExtent3DDict;
18 class ArrayBufferViewOrArrayBuffer;
19 template <typename T>
20 class Optional;
21 template <typename T>
22 class Sequence;
23 struct GPUCopyExternalImageDestInfo;
24 struct GPUCopyExternalImageSourceInfo;
25 struct GPUTexelCopyTextureInfo;
26 struct GPUTexelCopyBufferLayout;
27 struct TextureCopyView;
28 struct TextureDataLayout;
29 using GPUExtent3D = RangeEnforcedUnsignedLongSequenceOrGPUExtent3DDict;
30 } // namespace dom
31 namespace webgpu {
33 class Buffer;
34 class CommandBuffer;
35 class Device;
36 class Fence;
38 class Queue final : public ObjectBase, public ChildOf<Device> {
39 public:
40 GPU_DECL_CYCLE_COLLECTION(Queue)
41 GPU_DECL_JS_WRAP(Queue)
43 Queue(Device* const aParent, WebGPUChild* aBridge, RawId aId);
45 void Submit(
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,
53 ErrorResult& aRv);
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);
65 private:
66 virtual ~Queue();
67 void Cleanup() {}
69 RefPtr<WebGPUChild> mBridge;
70 const RawId mId;
72 public:
75 } // namespace webgpu
76 } // namespace mozilla
78 #endif // GPU_Queue_H_