/* * Copyright (c) 2022, Stephan Unverwerth * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include #include #include #include #include #include namespace GL { class Program final : public RefCounted { public: static NonnullRefPtr create(); bool is_shader_attached(Shader const&) const; ErrorOr attach_shader(Shader&); ErrorOr link(GPU::Device&); bool link_status() const { return m_link_status; } size_t info_log_length() const; private: bool m_link_status { false }; Vector> m_vertex_shaders; Vector> m_fragment_shaders; Optional m_info_log; OwnPtr m_linked_vertex_shader; OwnPtr m_linked_fragment_shader; RefPtr m_gpu_vertex_shader; RefPtr m_gpu_fragment_shader; }; }