27 public BackendCast<PipelineLibraryGLES, PipelineLibrary> {
47 std::shared_ptr<const ShaderFunction> vertex_shader;
48 std::shared_ptr<const ShaderFunction> fragment_shader;
53 std::vector<Scalar> specialization_constants;
55 ProgramKey(std::shared_ptr<const ShaderFunction> p_vertex_shader,
56 std::shared_ptr<const ShaderFunction> p_fragment_shader,
57 std::vector<Scalar> p_specialization_constants)
58 : vertex_shader(std::move(p_vertex_shader)),
59 fragment_shader(std::move(p_fragment_shader)),
60 specialization_constants(std::move(p_specialization_constants)) {}
65 if (
key.vertex_shader) {
68 if (
key.fragment_shader) {
71 for (
const auto& constant :
key.specialization_constants) {
79 bool operator()(
const ProgramKey& lhs,
const ProgramKey& rhs)
const {
82 lhs.specialization_constants == rhs.specialization_constants;
87 using ProgramMap = std::unordered_map<ProgramKey,
88 std::shared_ptr<UniqueHandleGLES>,
92 std::shared_ptr<ReactorGLES> reactor_;
94 Mutex programs_mutex_;
96 std::shared_ptr<PipelineCompileQueueGLES> compile_queue_;
99 std::shared_ptr<ReactorGLES>
reactor,
100 std::shared_ptr<fml::BasicTaskRunner> io_task_runner);
103 bool IsValid()
const override;
108 bool threadsafe)
override;
113 bool async)
override;
119 void RemovePipelinesWithEntryPoint(
120 std::shared_ptr<const ShaderFunction> function)
override;
122 const std::shared_ptr<ReactorGLES>& GetReactor()
const;
124 static std::shared_ptr<PipelineGLES> CreatePipeline(
125 const std::weak_ptr<PipelineLibrary>& weak_library,
127 const std::shared_ptr<const ShaderFunction>& vert_shader,
128 const std::shared_ptr<const ShaderFunction>& frag_shader,
131 std::shared_ptr<UniqueHandleGLES> GetProgramForKey(
const ProgramKey&
key);
133 void SetProgramForKey(
const ProgramKey&
key,
134 std::shared_ptr<UniqueHandleGLES> program);