• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_DawnGraphiteUtilsPriv_DEFINED
9 #define skgpu_graphite_DawnGraphiteUtilsPriv_DEFINED
10 
11 #include "include/core/SkImageInfo.h"
12 #include "src/gpu/graphite/ResourceTypes.h"
13 #include "src/sksl/SkSLProgramKind.h"
14 #include "src/sksl/ir/SkSLProgram.h"
15 
16 #include "webgpu/webgpu_cpp.h"  // NO_G3_REWRITE
17 
18 namespace SkSL {
19 class Compiler;
20 struct ProgramSettings;
21 }
22 
23 namespace skgpu {
24 class ShaderErrorHandler;
25 }
26 
27 namespace skgpu::graphite {
28 class DawnSharedContext;
29 
30 bool DawnFormatIsDepthOrStencil(wgpu::TextureFormat);
31 bool DawnFormatIsDepth(wgpu::TextureFormat);
32 bool DawnFormatIsStencil(wgpu::TextureFormat);
33 
34 wgpu::TextureFormat DawnDepthStencilFlagsToFormat(SkEnumBitMask<DepthStencilFlags>);
35 
36 bool DawnCompileWGSLShaderModule(const DawnSharedContext* sharedContext,
37                                  const char* label,
38                                  const std::string& wgsl,
39                                  wgpu::ShaderModule* module,
40                                  ShaderErrorHandler*);
41 
42 } // namespace skgpu::graphite
43 
44 #endif // skgpu_graphite_DawnGraphiteUtilsPriv_DEFINED
45