mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 21:06:09 +00:00
The five files the audit measured as Winlator's are replaced: a one-method callback interface by java.util.function.Consumer, the component base by SessionPart (attach an application context, start, stop), the environment list by HostEnvironment, the process starter by HostProcess, and the pad's state holder by PadState with named sticks, triggers, directions and buttons. The frame-generation tree is framegen/ (its contents were never Winlator's: lsfg-vk's port and Bannerlator's Win-FG), the log tags are the app's, and the fake pad's rumble socket is now one the app actually serves: RumbleComponent turns a game's force-feedback effects into the phone's vibrator, which used to go nowhere. The two design notes describing Bannerlator's X11 path are gone, and the README and credits say what is whose.
84 lines
2.5 KiB
C++
84 lines
2.5 KiB
C++
// 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
|
|
//
|
|
// Ported into Bannerlator's compositor from WinNative (GPL-3.0-or-later),
|
|
// whose LSFG port is credited to Camille LaVey / the Eden Emulator Project and
|
|
// follows upstream lsfg-vk. Only the Vulkan dispatch differs: Bannerlator
|
|
// resolves entry points through the renderer's own table (see lsfg_vkd.h).
|
|
|
|
#pragma once
|
|
|
|
#include <array>
|
|
|
|
#include "lsfg_alpha.hpp"
|
|
#include "lsfg_beta.hpp"
|
|
#include "lsfg_common.hpp"
|
|
#include "lsfg_delta.hpp"
|
|
#include "lsfg_gamma.hpp"
|
|
#include "lsfg_generate.hpp"
|
|
#include "lsfg_mipmaps.hpp"
|
|
|
|
namespace lsfg {
|
|
|
|
class LsfgShaders;
|
|
|
|
constexpr size_t LSFG_FIRST_DELTA_LEVEL = 4;
|
|
constexpr size_t LSFG_LAST_DELTA_LEVEL = LSFG_MIP_LEVELS - 1;
|
|
constexpr size_t LSFG_DELTA_INSTANCES = LSFG_LAST_DELTA_LEVEL + 1 - LSFG_FIRST_DELTA_LEVEL;
|
|
|
|
class LsfgChain {
|
|
public:
|
|
LsfgChain(const Device& device, const LsfgShaders& shaders, VkExtent2D extent, VkFormat format,
|
|
float flow_scale);
|
|
~LsfgChain();
|
|
|
|
LsfgChain(const LsfgChain&) = delete;
|
|
LsfgChain& operator=(const LsfgChain&) = delete;
|
|
|
|
void DispatchShared(VkCommandBuffer cmdbuf, uint64_t frame_count);
|
|
|
|
void DispatchGeneration(VkCommandBuffer cmdbuf, uint64_t frame_count, size_t generation_count,
|
|
size_t generation, uint32_t target, VkImage image, VkExtent2D extent);
|
|
|
|
void SetTarget(const Device& device, size_t generation_count, size_t generation,
|
|
uint32_t target, VkImageView view) {
|
|
generate.SetTarget(device, LsfgGenerationSlot(generation_count, generation), target, view);
|
|
}
|
|
|
|
void ForgetTargets() {
|
|
generate.ForgetTargets();
|
|
}
|
|
|
|
[[nodiscard]] LsfgImage& Input(uint64_t frame_count) {
|
|
return frames[frame_count % frames.size()];
|
|
}
|
|
|
|
[[nodiscard]] LsfgImage& FlowLevel(size_t level) {
|
|
return mipmaps.Output(level);
|
|
}
|
|
|
|
[[nodiscard]] bool Valid() const {
|
|
return valid;
|
|
}
|
|
|
|
private:
|
|
LsfgResources resources;
|
|
VkDevice owner{VK_NULL_HANDLE};
|
|
VkDescriptorPool descriptor_pool{VK_NULL_HANDLE};
|
|
|
|
LsfgImagePair frames;
|
|
LsfgMipmaps mipmaps;
|
|
LsfgAlphaPasses alpha_passes;
|
|
std::array<LsfgAlpha, LSFG_MIP_LEVELS> alpha;
|
|
LsfgBeta beta;
|
|
std::array<LsfgGamma, LSFG_MIP_LEVELS> gamma;
|
|
std::array<LsfgDelta, LSFG_DELTA_INSTANCES> delta;
|
|
LsfgGenerate generate;
|
|
bool valid{};
|
|
};
|
|
|
|
}
|