25 public BackendCast<PipelineLibraryGLES, PipelineLibrary> {
45 std::shared_ptr<const ShaderFunction> vertex_shader;
46 std::shared_ptr<const ShaderFunction> fragment_shader;
51 std::vector<Scalar> specialization_constants;
53 ProgramKey(std::shared_ptr<const ShaderFunction> p_vertex_shader,
54 std::shared_ptr<const ShaderFunction> p_fragment_shader,
55 std::vector<Scalar> p_specialization_constants)
56 : vertex_shader(std::move(p_vertex_shader)),
57 fragment_shader(std::move(p_fragment_shader)),
58 specialization_constants(std::move(p_specialization_constants)) {}
63 if (
key.vertex_shader) {
66 if (
key.fragment_shader) {
69 for (
const auto& constant :
key.specialization_constants) {
77 bool operator()(
const ProgramKey& lhs,
const ProgramKey& rhs)
const {
80 lhs.specialization_constants == rhs.specialization_constants;
85 using ProgramMap = std::unordered_map<ProgramKey,
86 std::shared_ptr<UniqueHandleGLES>,
90 std::shared_ptr<ReactorGLES> reactor_;
92 Mutex programs_mutex_;
98 bool IsValid()
const override;
103 bool threadsafe)
override;
108 bool async)
override;
114 void RemovePipelinesWithEntryPoint(
115 std::shared_ptr<const ShaderFunction> function)
override;
117 const std::shared_ptr<ReactorGLES>& GetReactor()
const;
119 static std::shared_ptr<PipelineGLES> CreatePipeline(
120 const std::weak_ptr<PipelineLibrary>& weak_library,
122 const std::shared_ptr<const ShaderFunction>& vert_shader,
123 const std::shared_ptr<const ShaderFunction>& frag_shader,
126 std::shared_ptr<UniqueHandleGLES> GetProgramForKey(
const ProgramKey&
key);
128 void SetProgramForKey(
const ProgramKey&
key,
129 std::shared_ptr<UniqueHandleGLES> program);