| 1 |
/* |
| 2 |
* Copyright 2022 Google LLC |
| 3 |
* |
| 4 |
* Use of this source code is governed by a BSD-style license that can be |
| 5 |
* found in the LICENSE file. |
| 6 |
*/ |
| 7 |
|
| 8 |
#ifndef skgpu_graphite_DawnQueueManager_DEFINED |
| 9 |
#define skgpu_graphite_DawnQueueManager_DEFINED |
| 10 |
|
| 11 |
#include "src/gpu/graphite/QueueManager.h" |
| 12 |
|
| 13 |
#include "webgpu/webgpu_cpp.h" // NO_G3_REWRITE |
| 14 |
|
| 15 |
namespace skgpu::graphite { |
| 16 |
|
| 17 |
class DawnSharedContext; |
| 18 |
class SharedContext; |
| 19 |
|
| 20 |
class DawnQueueManager : public QueueManager { |
| 21 |
public: |
| 22 |
DawnQueueManager(wgpu::Queue, const SharedContext*); |
| 23 |
~DawnQueueManager() override {} |
| 24 |
|
| 25 |
const wgpu::Queue& dawnQueue() const { return fQueue; } |
| 26 |
|
| 27 |
void tick() const override; |
| 28 |
|
| 29 |
private: |
| 30 |
const DawnSharedContext* dawnSharedContext() const; |
| 31 |
|
| 32 |
std::unique_ptr<CommandBuffer> getNewCommandBuffer(ResourceProvider*, Protected) override; |
| 33 |
OutstandingSubmission onSubmitToGpu(const SubmitInfo&) override; |
| 34 |
|
| 35 |
#if defined(GPU_TEST_UTILS) |
| 36 |
void startCapture() override; |
| 37 |
void stopCapture() override; |
| 38 |
#endif |
| 39 |
|
| 40 |
wgpu::Queue fQueue; |
| 41 |
}; |
| 42 |
|
| 43 |
} // namespace skgpu::graphite |
| 44 |
|
| 45 |
#endif // skgpu_graphite_DawnQueueManager_DEFINED |