Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
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 <set>
9
12#include "impeller/shader_bundle/shader_bundle_flatbuffers.h"
13
14namespace impeller {
15namespace compiler {
16
17/// @brief Parse a shader bundle configuration from a given JSON string.
18///
19/// @note Exposed only for testing purposes. Use `GenerateShaderBundle`
20/// directly.
21std::optional<ShaderBundleConfig> ParseShaderBundleConfig(
22 const std::string& bundle_config_json,
23 std::ostream& error_stream);
24
25/// @brief Parses the JSON shader bundle configuration and invokes the
26/// compiler multiple times to produce a shader bundle flatbuffer.
27///
28/// @note Exposed only for testing purposes. Use `GenerateShaderBundle`
29/// directly.
30///
31/// @param out_dependencies Optional. When non-null, populated with the
32/// set of source files (including transitive
33/// `#include`s) that contributed to the
34/// generated bundle. Used by `GenerateShaderBundle`
35/// to emit a depfile when `--depfile` is set.
36std::optional<fb::shaderbundle::ShaderBundleT> GenerateShaderBundleFlatbuffer(
37 const std::string& bundle_config_json,
38 const SourceOptions& options,
39 std::set<std::string>* out_dependencies = nullptr);
40
41/// @brief Parses the JSON shader bundle configuration and invokes the
42/// compiler multiple times to produce a shader bundle flatbuffer, which
43/// is then output to the `sl` file.
44bool GenerateShaderBundle(Switches& switches);
45
46} // namespace compiler
47} // namespace impeller
48
49#endif // FLUTTER_IMPELLER_COMPILER_SHADER_BUNDLE_H_
std::optional< fb::shaderbundle::ShaderBundleT > GenerateShaderBundleFlatbuffer(const std::string &bundle_config_json, const SourceOptions &options, std::set< std::string > *out_dependencies)
Parses the JSON shader bundle configuration and invokes the compiler multiple times to produce a shad...
bool GenerateShaderBundle(Switches &switches)
Parses the JSON shader bundle configuration and invokes the compiler multiple times to produce a shad...
std::optional< ShaderBundleConfig > ParseShaderBundleConfig(const std::string &bundle_config_json, std::ostream &error_stream)
Parse a shader bundle configuration from a given JSON string.