#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 "utils/utils.hpp" #include #include #include #include namespace LSFG::Shaders { /// /// Delta shader. /// class Delta { public: Delta() = default; /// /// Initialize the shaderchain. /// /// @param inImgs1 Three sets of four RGBA images, corresponding to a frame count % 3. /// @param inImg2 Second Input image /// @param optImg1 Optional image for non-first passes. /// @param optImg2 Second optional image for non-first passes. /// @param optImg3 Third optional image for non-first passes. /// /// @throws LSFG::vulkan_error if resource creation fails. /// Delta(Vulkan& vk, std::array, 3> inImgs1, Core::Image inImg2, std::optional optImg1, std::optional optImg2, std::optional optImg3); /// /// Dispatch the shaderchain. /// void Dispatch(const Core::CommandBuffer& buf, uint64_t frameCount, uint64_t pass_idx); /// Get the first output image [[nodiscard]] const auto& getOutImage1() const { return this->outImg1; } /// Get the second output image [[nodiscard]] const auto& getOutImage2() const { return this->outImg2; } /// Trivially copyable, moveable and destructible Delta(const Delta&) noexcept = default; Delta& operator=(const Delta&) noexcept = default; Delta(Delta&&) noexcept = default; Delta& operator=(Delta&&) noexcept = default; ~Delta() = default; private: std::array shaderModules; std::array pipelines; std::array samplers; struct DeltaPass { Core::Buffer buffer; std::array firstDescriptorSet; std::array descriptorSets; std::array sixthDescriptorSet; }; std::vector passes; std::array, 3> inImgs1; Core::Image inImg2; std::optional optImg1, optImg2, optImg3; std::array tempImgs1; std::array tempImgs2; Core::Image outImg1, outImg2; }; }