Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
runtime_stage_data.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_RUNTIME_STAGE_DATA_H_
6#define FLUTTER_IMPELLER_COMPILER_RUNTIME_STAGE_DATA_H_
7
8#include <memory>
9#include <vector>
10
11#include "flutter/fml/macros.h"
12#include "flutter/fml/mapping.h"
15#include "runtime_stage_types_flatbuffers.h"
16#include "spirv_parser.hpp"
17
18namespace impeller {
19namespace compiler {
20
22 public:
23 struct Shader {
24 Shader() = default;
25
26 std::string entrypoint;
27 spv::ExecutionModel stage;
28 std::vector<UniformDescription> uniforms;
29 std::vector<InputDescription> inputs;
30 std::shared_ptr<fml::Mapping> shader;
32
33 Shader(const Shader&) = delete;
34 Shader& operator=(const Shader&) = delete;
35 };
36
38
40
41 void AddShader(const std::shared_ptr<Shader>& data);
42
43 std::unique_ptr<fb::RuntimeStageT> CreateStageFlatbuffer(
44 impeller::RuntimeStageBackend backend) const;
45
46 std::unique_ptr<fb::RuntimeStagesT> CreateMultiStageFlatbuffer() const;
47
48 std::shared_ptr<fml::Mapping> CreateJsonMapping() const;
49
50 std::shared_ptr<fml::Mapping> CreateMapping() const;
51
52 private:
53 std::map<RuntimeStageBackend, std::shared_ptr<Shader>> data_;
54
55 RuntimeStageData(const RuntimeStageData&) = delete;
56
57 RuntimeStageData& operator=(const RuntimeStageData&) = delete;
58};
59
60} // namespace compiler
61} // namespace impeller
62
63#endif // FLUTTER_IMPELLER_COMPILER_RUNTIME_STAGE_DATA_H_
std::unique_ptr< fb::RuntimeStagesT > CreateMultiStageFlatbuffer() const
std::shared_ptr< fml::Mapping > CreateMapping() const
std::unique_ptr< fb::RuntimeStageT > CreateStageFlatbuffer(impeller::RuntimeStageBackend backend) const
void AddShader(const std::shared_ptr< Shader > &data)
std::shared_ptr< fml::Mapping > CreateJsonMapping() const
Shader & operator=(const Shader &)=delete
std::vector< UniformDescription > uniforms