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" 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*); ~DawnQueueManager()23 ~DawnQueueManager() override {} 24 dawnQueue()25 const wgpu::Queue& dawnQueue() const { return fQueue; } 26 27 private: 28 const DawnSharedContext* dawnSharedContext() const; 29 30 std::unique_ptr<CommandBuffer> getNewCommandBuffer(ResourceProvider*) override; 31 OutstandingSubmission onSubmitToGpu() override; 32 33 #if GRAPHITE_TEST_UTILS 34 void startCapture() override; 35 void stopCapture() override; 36 #endif 37 38 wgpu::Queue fQueue; 39 }; 40 41 } // namespace skgpu::graphite 42 43 #endif // skgpu_graphite_DawnQueueManager_DEFINED 44