Debian Codegraph @

src/gpu/graphite/dawn/DawnComputePipeline.h

raw
1 /*
2 * Copyright 2023 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_DawnComputePipeline_DEFINED
9 #define skgpu_graphite_DawnComputePipeline_DEFINED
10
11 #include "include/core/SkRefCnt.h"
12 #include "src/gpu/graphite/ComputePipeline.h"
13
14 #include "webgpu/webgpu_cpp.h" // NO_G3_REWRITE
15
16 namespace skgpu::graphite {
17
18 class ComputePipelineDesc;
19 class DawnComputePipelineDesc;
20 class DawnSharedContext;
21
22 class DawnComputePipeline final : public ComputePipeline {
23 public:
24 static sk_sp<DawnComputePipeline> Make(const DawnSharedContext*, const ComputePipelineDesc&);
25 ~DawnComputePipeline() override = default;
26
27 const wgpu::ComputePipeline& dawnComputePipeline() const { return fPipeline; }
28 const wgpu::BindGroupLayout& dawnGroupLayout() const { return fGroupLayout; }
29
30 private:
31 DawnComputePipeline(const SharedContext*, wgpu::ComputePipeline, wgpu::BindGroupLayout);
32
33 void freeGpuData() override;
34
35 wgpu::ComputePipeline fPipeline;
36 wgpu::BindGroupLayout fGroupLayout;
37 };
38
39 } // namespace skgpu::graphite
40
41 #endif // skgpu_graphite_DawnComputePipeline_DEFINED