Flutter Engine
The Flutter Engine
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/mapping.h"
14#include "runtime_stage_types_flatbuffers.h"
15#include "spirv_parser.hpp"
16
17namespace impeller {
18namespace compiler {
19
21 public:
22 struct Shader {
23 Shader() = default;
24
25 std::string entrypoint;
26 spv::ExecutionModel stage;
27 std::vector<UniformDescription> uniforms;
28 std::vector<InputDescription> inputs;
29 std::shared_ptr<fml::Mapping> shader;
31
32 Shader(const Shader&) = delete;
33 Shader& operator=(const Shader&) = delete;
34 };
35
37
39
40 void AddShader(const std::shared_ptr<Shader>& data);
41
42 std::unique_ptr<fb::RuntimeStageT> CreateStageFlatbuffer(
44
45 std::unique_ptr<fb::RuntimeStagesT> CreateMultiStageFlatbuffer() const;
46
47 std::shared_ptr<fml::Mapping> CreateJsonMapping() const;
48
49 std::shared_ptr<fml::Mapping> CreateMapping() const;
50
51 private:
52 std::map<RuntimeStageBackend, std::shared_ptr<Shader>> data_;
53
54 RuntimeStageData(const RuntimeStageData&) = delete;
55
56 RuntimeStageData& operator=(const RuntimeStageData&) = delete;
57};
58
59} // namespace compiler
60} // namespace impeller
61
62#endif // FLUTTER_IMPELLER_COMPILER_RUNTIME_STAGE_DATA_H_
const char * backend
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< InputDescription > inputs
std::vector< UniformDescription > uniforms
std::shared_ptr< fml::Mapping > shader
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63