Debian Codegraph @

src/gpu/graphite/dawn/DawnSampler.h

raw
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_DawnSampler_DEFINED
9 #define skgpu_graphite_DawnSampler_DEFINED
10
11 #include "src/gpu/graphite/Sampler.h"
12
13 #include "include/core/SkTileMode.h"
14 #include "webgpu/webgpu_cpp.h" // NO_G3_REWRITE
15
16 struct SkSamplingOptions;
17
18 namespace skgpu::graphite {
19
20 class DawnSharedContext;
21
22 class DawnSampler : public Sampler {
23 public:
24 static sk_sp<DawnSampler> Make(const DawnSharedContext*, SamplerDesc);
25
26 ~DawnSampler() override {}
27
28 SamplerDesc samplerDesc() const { return fSamplerDesc; }
29
30 const wgpu::Sampler& dawnSampler() const { return fSampler; }
31
32 private:
33 DawnSampler(const DawnSharedContext*, SamplerDesc, wgpu::Sampler);
34
35 void freeGpuData() override;
36
37 wgpu::Sampler fSampler;
38 SamplerDesc fSamplerDesc;
39 };
40
41 } // namepsace skgpu::graphite
42
43 #endif // skgpu_graphite_DawnSampler_DEFINED