#pragma once #include "core/buffer.hpp" #include "core/commandbuffer.hpp" #include "core/descriptorset.hpp" #include "core/image.hpp" #include "core/pipeline.hpp" #include "core/sampler.hpp" #include "core/shadermodule.hpp" #include "common/utils.hpp" #include #include #include #include namespace LSFG::Shaders { /// /// Gamma shader. /// class Gamma { public: Gamma() = default; /// /// Initialize the shaderchain. /// /// @param inImgs1 Three sets of four RGBA images, corresponding to a frame count % 3. /// @param inImg2 Second Input image /// @param optImg Optional image for non-first passes. /// /// @throws LSFG::vulkan_error if resource creation fails. /// Gamma(Vulkan& vk, std::array, 3> inImgs1, Core::Image inImg2, std::optional optImg); /// /// Dispatch the shaderchain. /// void Dispatch(const Core::CommandBuffer& buf, uint64_t frameCount, uint64_t pass_idx); /// Get the output image [[nodiscard]] const auto& getOutImage() const { return this->outImg; } /// Trivially copyable, moveable and destructible Gamma(const Gamma&) noexcept = default; Gamma& operator=(const Gamma&) noexcept = default; Gamma(Gamma&&) noexcept = default; Gamma& operator=(Gamma&&) noexcept = default; ~Gamma() = default; private: std::array shaderModules; std::array pipelines; std::array samplers; struct GammaPass { Core::Buffer buffer; std::array firstDescriptorSet; std::array descriptorSets; }; std::vector passes; std::array, 3> inImgs1; Core::Image inImg2; std::optional optImg; std::array tempImgs1; std::array tempImgs2; Core::Image outImg; }; }