The lsfg-vk project has prepared an unofficial port of the Lossless Scalings Frame Generation (LSFG) utility for the Linux platform, utilizing DXVK and the Vulkan graphics API. The project code is written in C++ and is released under the MIT License. The development has been carried out by an independent enthusiast who has recreated the functionality of the proprietary LSFG through reverse engineering of Windows libraries.
The application allows for scaling the output of game applications designed to run in a separate window for full-screen display. The utility may also be necessary to eliminate blurred output when scaling using the native graphics subsystem or to bypass limitations in games that are tied to fixed screen resolutions. Additionally, there is an option to enhance output smoothness and increase frame rates in games not designed for high FPS by interpolating additional frames based on neighboring frames.
For recreating missing details and scaling in LSFG, both original proprietary algorithms and existing machine learning-based technologies such as AMD FidelityFX Super Resolution and NVIDIA Image Scaling can be used. The choice of algorithm depends on the type of game applications. For modern games, it is recommended to use the proprietary LS1 algorithm or AMD FSR super sampling technology. For older pixel-art games, Integer Scaling and xBR algorithms are suggested, while for cartoon and anime-style games, the Anime4K algorithm is available. In addition to games, output modifications can also be applied to emulators for running retro games and console games.
Scaling and frame interpolation occur in real-time and do not require modifications to the games. In the Linux version, frame interpolation and integration into the game output is achieved by connecting a handler in the form of an additional Vulkan layer, through which existing Vulkan functions are intercepted, executed, and modified. To use lsfg-vk, it is sufficient to install the liblsfg-vk.so library and configure its parameters through environment variables.
The original LSFG is a compiled application for Windows based on the D3D11 API. To recreate LSFG functionality in Linux, the implementation was translated into a version that uses the Vulkan API. A handler was added to transfer shaders, intercepting D3D11 calls and saving shaders to disk, along with a parser for dynamically extracting shaders from executables in PE (Portable Executable) format. For the transfer of the graphical pipeline managing shader execution, components based on the D3D11 API were allocated, and their operation in Linux was ensured using DXVK. After obtaining a working version based on D3D11 and DXVK, an accurate layout of Vulkan calls was obtained using the RenderDoc debugger, which formed the basis for the final version that directly uses the Vulkan API.
Source: opennet.ru
