1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
// 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
#pragma once
#include <array>
#include "common/common_types.h"
#include "video_core/renderer_vulkan/present/lsfg_common.h"
namespace Vulkan {
class Device;
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, MemoryAllocator& memory_allocator, const LsfgShaders& shaders,
LsfgResources& resources, vk::DescriptorPool& descriptor_pool,
LsfgImageHistory& inputs, LsfgImage& flow_input, LsfgImage* previous_gamma,
LsfgImage* previous1, LsfgImage* previous2);
void Dispatch(vk::CommandBuffer cmdbuf, u64 frame_count, size_t slot);
[[nodiscard]] LsfgImage& Output1() {
return out_image1;
}
[[nodiscard]] LsfgImage& Output2() {
return out_image2;
}
private:
struct Generation {
std::array<VkDescriptorSet, LSFG_HISTORY_SLOTS> first_descriptor_sets{};
std::array<VkDescriptorSet, LSFG_HISTORY_SLOTS> sixth_descriptor_sets{};
std::array<VkDescriptorSet, LSFG_DELTA_STAGES - 2> descriptor_sets{};
};
LsfgImageHistory* inputs{};
LsfgImage* flow_input{};
LsfgImage* previous_gamma{};
LsfgImage* previous1{};
LsfgImage* previous2{};
std::array<LsfgPass, LSFG_DELTA_STAGES> passes;
std::array<Generation, LSFG_GENERATION_SLOTS> generations{};
vk::DescriptorSets owned_sets;
std::array<LsfgImage, LSFG_DELTA_TEMPS> temp1;
LsfgImagePair temp2;
LsfgImage out_image1;
LsfgImage out_image2;
};
} // namespace Vulkan
|