// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2025 lsfg-vk // SPDX-License-Identifier: GPL-3.0-or-later // // LSFG from the work of Camille LaVey / the Eden Emulator Project, following // upstream lsfg-vk. Ported to WinNative and DroidDeck by @maxjivi05; only the // Vulkan dispatch differs here (see lsfg_vkd.h). #pragma once #include #include "lsfg_common.hpp" namespace lsfg { class LsfgShaders; constexpr size_t LSFG_DELTA_STAGES = 10; constexpr size_t LSFG_DELTA_TEMPS = 3; class LsfgDelta { public: LsfgDelta() = default; LsfgDelta(const Device& device, const LsfgShaders& shaders, LsfgResources& resources, VkDescriptorPool descriptor_pool, LsfgImageHistory& inputs, LsfgImage& flow_input, LsfgImage* previous_gamma, LsfgImage* previous1, LsfgImage* previous2); void Dispatch(VkCommandBuffer cmdbuf, uint64_t frame_count, size_t slot); void PushStepBarriers(LsfgBarriers& barriers, uint64_t frame_count, size_t step); void DispatchStep(VkCommandBuffer cmdbuf, uint64_t frame_count, size_t slot, size_t step); [[nodiscard]] LsfgImage& Output1() { return out_image1; } [[nodiscard]] LsfgImage& Output2() { return out_image2; } [[nodiscard]] bool Valid() const { return allocated; } private: struct Generation { std::array first_descriptor_sets{}; std::array sixth_descriptor_sets{}; std::array descriptor_sets{}; }; LsfgImageHistory* inputs{}; LsfgImage* flow_input{}; LsfgImage* previous_gamma{}; LsfgImage* previous1{}; LsfgImage* previous2{}; std::array passes; std::array generations{}; std::array temp1; LsfgImagePair temp2; LsfgImage out_image1; LsfgImage out_image2; bool allocated{}; }; }