| Flutter Impeller |

shader_bundle.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FLUTTER_IMPELLER_COMPILER_SHADER_BUNDLE_H_
6 #define FLUTTER_IMPELLER_COMPILER_SHADER_BUNDLE_H_
7
8 #include "impeller/compiler/source_options.h"
9 #include "impeller/compiler/switches.h"
10 #include "impeller/shader_bundle/shader_bundle_flatbuffers.h"
11
12 namespace impeller {
13 namespace compiler {
14
15 /// @brief Parse a shader bundle configuration from a given JSON string.
16 ///
17 /// @note Exposed only for testing purposes. Use `GenerateShaderBundle`
18 /// directly.
19 std::optional<ShaderBundleConfig> ParseShaderBundleConfig(
20 const std::string& bundle_config_json,
21 std::ostream& error_stream);
22
23 /// @brief Parses the JSON shader bundle configuration and invokes the
24 /// compiler multiple times to produce a shader bundle flatbuffer.
25 ///
26 /// @note Exposed only for testing purposes. Use `GenerateShaderBundle`
27 /// directly.
28 std::optional<fb::shaderbundle::ShaderBundleT> GenerateShaderBundleFlatbuffer(
29 const std::string& bundle_config_json,
30 const SourceOptions& options);
31
32 /// @brief Parses the JSON shader bundle configuration and invokes the
33 /// compiler multiple times to produce a shader bundle flatbuffer, which
34 /// is then output to the `sl` file.
35 bool GenerateShaderBundle(Switches& switches);
36
37 } // namespace compiler
38 } // namespace impeller
39
40 #endif // FLUTTER_IMPELLER_COMPILER_SHADER_BUNDLE_H_
switches.h
impeller::compiler::GenerateShaderBundleFlatbuffer
std::optional< fb::shaderbundle::ShaderBundleT > GenerateShaderBundleFlatbuffer(const std::string &bundle_config_json, const SourceOptions &options)
Parses the JSON shader bundle configuration and invokes the compiler multiple times to produce a shad...
Definition: shader_bundle.cc:179
impeller::compiler::GenerateShaderBundle
bool GenerateShaderBundle(Switches &switches)
Parses the JSON shader bundle configuration and invokes the compiler multiple times to produce a shad...
Definition: shader_bundle.cc:210
impeller::compiler::ParseShaderBundleConfig
std::optional< ShaderBundleConfig > ParseShaderBundleConfig(const std::string &bundle_config_json, std::ostream &error_stream)
Parse a shader bundle configuration from a given JSON string.
Definition: shader_bundle.cc:19
impeller
Definition: allocation.cc:12
source_options.h