Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
DawnUtilsPriv.h
Go to the documentation of this file.
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_DawnUtilsPriv_DEFINED
9#define skgpu_DawnUtilsPriv_DEFINED
10
14#include "webgpu/webgpu_cpp.h" // NO_G3_REWRITE
15
16namespace SkSL {
17
18enum class ProgramKind : int8_t;
19struct ProgramInterface;
20struct ProgramSettings;
21struct ShaderCaps;
22
23} // namespace SkSL
24
25namespace skgpu {
26
27class ShaderErrorHandler;
28
29inline bool SkSLToWGSL(const SkSL::ShaderCaps* caps,
30 const std::string& sksl,
31 SkSL::ProgramKind programKind,
32 const SkSL::ProgramSettings& settings,
33 std::string* wgsl,
34 SkSL::ProgramInterface* outInterface,
35 ShaderErrorHandler* errorHandler) {
36 return SkSLToBackend(caps, &SkSL::ToWGSL, "WGSL",
37 sksl, programKind, settings, wgsl, outInterface, errorHandler);
38}
39
40namespace graphite {
41
42class DawnSharedContext;
43
44size_t DawnFormatBytesPerBlock(wgpu::TextureFormat format);
45
47
48uint32_t DawnFormatChannels(wgpu::TextureFormat format);
49
50} // namespace graphite
51} // namespace skgpu
52
53#endif // skgpu_DawnUtilsPriv_DEFINED
uint32_t uint32_t * format
bool ToWGSL(Program &program, const ShaderCaps *caps, OutputStream &out)
SkTextureCompressionType DawnFormatToCompressionType(wgpu::TextureFormat format)
Definition DawnUtils.cpp:49
uint32_t DawnFormatChannels(wgpu::TextureFormat format)
Definition DawnUtils.cpp:57
size_t DawnFormatBytesPerBlock(wgpu::TextureFormat format)
Definition DawnUtils.cpp:21
bool SkSLToWGSL(const SkSL::ShaderCaps *caps, const std::string &sksl, SkSL::ProgramKind programKind, const SkSL::ProgramSettings &settings, std::string *wgsl, SkSL::ProgramInterface *outInterface, ShaderErrorHandler *errorHandler)
bool SkSLToBackend(const SkSL::ShaderCaps *caps, bool(*toBackend)(SkSL::Program &, const SkSL::ShaderCaps *, std::string *), const char *backendLabel, const std::string &sksl, SkSL::ProgramKind programKind, const SkSL::ProgramSettings &settings, std::string *output, SkSL::ProgramInterface *outInterface, ShaderErrorHandler *errorHandler)