mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 21:06:09 +00:00
* feat(lsfg): take Lossless Scaling from Steam by itself, import it once owned, rebuild on update - Lossless.kt owns the DLL and its shader cache. The copy the Steam client installs (runtime library or the card's) is taken by itself and taken again when the client updates it (size/mtime stamp). The DLL is copied in and built into a cache named after its SHA-256, so a new DLL hands the compositor a new path; a build that fails keeps the working cache. Builds are serialized. - The Steam session asks the signed-in client once per session whether the account owns app 993090 until the answer is yes, then records it and the app stops asking (BL_LOSSLESS_OWNED). Once owned, the frame generation menu offers "Import Lossless.dll…", on the main screen and in the session drawer; an import stays until Steam's copy changes. - The compositor restarts the LSFG engine when its cache path changes, and a new engine selection clears an earlier start failure, so an updated DLL or a retry no longer needs the app restarted. - The HUD says when LSFG is waiting on Lossless Scaling instead of "starting"; frame generation strings are resources. - Removed LsfgNative's unused DLL variant and cache-match calls. * Find Lossless.dll in added Games libraries too * LSFG: 120, 90 and 60 fps targets alongside 2x-4x The pacer's target-rate mode picks 0-3 generations per game frame. While it is warm the input ring and shared chain follow every frame, so frames that generate nothing don't leave the next one without history. * Credit LSFG: Camille LaVey / Eden, ported to WinNative and DroidDeck by @maxjivi05 * LSFG: aim 0.1 fps under the target so output never passes the refresh rate
70 lines
1.7 KiB
C++
70 lines
1.7 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
|
|
//
|
|
// 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 <array>
|
|
|
|
#include "lsfg_common.hpp"
|
|
|
|
namespace lsfg {
|
|
|
|
class LsfgShaders;
|
|
|
|
constexpr size_t LSFG_ALPHA_STAGES = 4;
|
|
|
|
class LsfgAlphaPasses {
|
|
public:
|
|
LsfgAlphaPasses() = default;
|
|
LsfgAlphaPasses(const Device& device, const LsfgShaders& shaders);
|
|
|
|
[[nodiscard]] const LsfgPass& Get(size_t stage) const {
|
|
return passes[stage];
|
|
}
|
|
|
|
[[nodiscard]] bool Valid() const;
|
|
|
|
private:
|
|
std::array<LsfgPass, LSFG_ALPHA_STAGES> passes;
|
|
};
|
|
|
|
class LsfgAlpha {
|
|
public:
|
|
LsfgAlpha() = default;
|
|
LsfgAlpha(const Device& device, const LsfgAlphaPasses& passes, LsfgResources& resources,
|
|
VkDescriptorPool descriptor_pool, LsfgImage& input);
|
|
|
|
void PushBarriers(LsfgBarriers& barriers, uint64_t frame_count, size_t stage);
|
|
void DispatchStage(VkCommandBuffer cmdbuf, uint64_t frame_count, size_t stage);
|
|
|
|
[[nodiscard]] LsfgImageHistory& Outputs() {
|
|
return out_images;
|
|
}
|
|
|
|
[[nodiscard]] bool Valid() const {
|
|
return allocated;
|
|
}
|
|
|
|
private:
|
|
const LsfgAlphaPasses* passes{};
|
|
LsfgImage* input{};
|
|
|
|
std::array<VkDescriptorSet, LSFG_ALPHA_STAGES - 1> descriptor_sets{};
|
|
std::array<VkDescriptorSet, LSFG_HISTORY_SLOTS> last_descriptor_sets{};
|
|
|
|
LsfgImage temp1;
|
|
LsfgImage temp2;
|
|
LsfgImagePair temp3;
|
|
LsfgImageHistory out_images;
|
|
bool allocated{};
|
|
};
|
|
|
|
}
|