Debian Codegraph @

src/gpu/SkSLToBackend.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_SkSLToBackend_DEFINED
9 #define skgpu_SkSLToBackend_DEFINED
10
11 #include <cstdint>
12 #include <string>
13
14 namespace SkSL {
15
16 struct NativeShader;
17 enum class ProgramKind : int8_t;
18 struct Program;
19 struct ProgramInterface;
20 struct ProgramSettings;
21 struct ShaderCaps;
22
23 } // namespace SkSL
24
25 namespace skgpu {
26
27 class ShaderErrorHandler;
28
29 /**
30 * Wrapper for the SkSL compiler with useful logging and error handling.
31 * Depending on whether the output is text or binary, either output->fText or output->fBinary is
32 * filled.
33 */
34 bool SkSLToBackend(const SkSL::ShaderCaps* caps,
35 bool (*toBackend)(SkSL::Program&, const SkSL::ShaderCaps*, SkSL::NativeShader*),
36 const char* backendLabel,
37 const std::string& sksl,
38 SkSL::ProgramKind programKind,
39 const SkSL::ProgramSettings& settings,
40 SkSL::NativeShader* output,
41 SkSL::ProgramInterface* outInterface,
42 ShaderErrorHandler* errorHandler);
43
44 } // namespace skgpu
45
46 #endif // skgpu_SkSLToBackend_DEFINED