2018-11-30 22:52:05 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2018-06-13 20:43:48 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2019-10-02 19:46:03 +03:00
|
|
|
#ifndef GPU_Queue_H_
|
|
|
|
#define GPU_Queue_H_
|
2018-06-13 20:43:48 +03:00
|
|
|
|
|
|
|
#include "nsWrapperCache.h"
|
|
|
|
#include "ObjectModel.h"
|
2020-07-29 01:26:21 +03:00
|
|
|
#include "mozilla/dom/TypedArray.h"
|
2018-06-13 20:43:48 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
2020-07-29 01:26:21 +03:00
|
|
|
class ErrorResult;
|
2020-01-22 10:31:51 +03:00
|
|
|
namespace dom {
|
2020-07-29 01:26:21 +03:00
|
|
|
class RangeEnforcedUnsignedLongSequenceOrGPUExtent3DDict;
|
|
|
|
template <typename T>
|
|
|
|
class Optional;
|
2020-01-22 10:31:51 +03:00
|
|
|
template <typename T>
|
|
|
|
class Sequence;
|
2020-07-29 01:26:21 +03:00
|
|
|
struct TextureCopyView;
|
|
|
|
struct TextureDataLayout;
|
|
|
|
typedef RangeEnforcedUnsignedLongSequenceOrGPUExtent3DDict GPUExtent3D;
|
|
|
|
} // namespace dom
|
2018-06-13 20:43:48 +03:00
|
|
|
namespace webgpu {
|
|
|
|
|
2020-07-29 01:26:21 +03:00
|
|
|
class Buffer;
|
2018-06-13 20:43:48 +03:00
|
|
|
class CommandBuffer;
|
|
|
|
class Device;
|
|
|
|
class Fence;
|
|
|
|
|
2019-10-02 19:46:03 +03:00
|
|
|
class Queue final : public ObjectBase, public ChildOf<Device> {
|
2018-06-13 20:43:48 +03:00
|
|
|
public:
|
2019-10-02 19:46:03 +03:00
|
|
|
GPU_DECL_CYCLE_COLLECTION(Queue)
|
|
|
|
GPU_DECL_JS_WRAP(Queue)
|
2018-06-13 20:43:48 +03:00
|
|
|
|
2020-01-22 10:31:51 +03:00
|
|
|
Queue(Device* const aParent, WebGPUChild* aBridge, RawId aId);
|
|
|
|
|
|
|
|
void Submit(
|
|
|
|
const dom::Sequence<OwningNonNull<CommandBuffer>>& aCommandBuffers);
|
|
|
|
|
2020-07-29 01:26:21 +03:00
|
|
|
void WriteBuffer(const Buffer& aBuffer, uint64_t aBufferOffset,
|
|
|
|
const dom::ArrayBuffer& adata, uint64_t aDataOffset,
|
|
|
|
const dom::Optional<uint64_t>& aSize, ErrorResult& aRv);
|
|
|
|
|
|
|
|
void WriteTexture(const dom::GPUTextureCopyView& aDestination,
|
|
|
|
const dom::ArrayBuffer& aData,
|
|
|
|
const dom::GPUTextureDataLayout& aDataLayout,
|
|
|
|
const dom::GPUExtent3D& aSize, ErrorResult& aRv);
|
|
|
|
|
2018-06-13 20:43:48 +03:00
|
|
|
private:
|
|
|
|
Queue() = delete;
|
|
|
|
virtual ~Queue();
|
2020-01-22 10:31:51 +03:00
|
|
|
void Cleanup() {}
|
|
|
|
|
|
|
|
RefPtr<WebGPUChild> mBridge;
|
|
|
|
const RawId mId;
|
2018-06-13 20:43:48 +03:00
|
|
|
|
|
|
|
public:
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace webgpu
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2019-10-02 19:46:03 +03:00
|
|
|
#endif // GPU_Queue_H_
|