/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ #pragma once #include "IRecordable.hpp" #include "Scene/Shader/Shader.hpp" #include #include namespace OpenVulkano::Vulkan { class Context; class IShaderOwner; class VulkanShader final : public IRenderResource, public IRecordable { public: vk::Device device; std::vector shaderModules; // TODO manage live time somewhere else to allow sharing of shader programs std::vector shaderStageCreateInfo; vk::Pipeline pipeline; // TODO pipeline and shader config should be split std::vector descriptorSetLayouts; vk::PipelineLayout pipelineLayout; IShaderOwner* owner = nullptr; Context* context = nullptr; VulkanShader(Context* context, Scene::Shader* shader, IShaderOwner* owner); ~VulkanShader() override; void Resize(); void Record(VulkanDrawContext* context) override; void Release() override; private: void BuildPipeline(); void CreatePipelineLayout(); }; }