mirror of
https://github.com/pabloaul/lsfg-vk-flake.git
synced 2025-08-28 11:26:29 -03:00
Compare commits
No commits in common. "0e4a10cb682203494c1c7fde54124d76c5c91b9b" and "f24d8fe3714cabc69073568efece5e9e5c153fe7" have entirely different histories.
0e4a10cb68
...
f24d8fe371
4 changed files with 10 additions and 82 deletions
59
README.md
59
README.md
|
@ -1,56 +1,11 @@
|
||||||
# lsfg-vk-flake
|
# lsfg-vk-flake
|
||||||
Nix flake for using [Lossless Scaling's frame generation on Linux](https://github.com/PancakeTAS/lsfg-vk)
|
WIP! Nix flake to build the library for using Lossless Scaling's frame generation on Linux
|
||||||
|
|
||||||
>[!IMPORTANT]
|
current state: builds and seems to be functional
|
||||||
> You need to have Lossless Scaling installed on Steam!
|
|
||||||
> In case it is not installed on the default Steam drive, you may want to consider setting the environment variable ``LSFG_DLL_PATH=<ABSOLUTE_PATH_TO>/Lossless.dll``
|
|
||||||
|
|
||||||
## Installation
|
## manual install
|
||||||
### System-wide (NixOS module)
|
1. build the library with ``nix build``
|
||||||
This approach will install an implicit layer to ``/etc/vulkan/implicit_layer.d/``
|
2. copy library and vulkan layer config to your ~/.local: ``cp -r result/* ~/.local/`` (check contents of result first!)
|
||||||
|
3. have lossless scaling installed on Steam or manually reference the DLL file using LSFG_DLL_PATH
|
||||||
|
|
||||||
Add this repository to your flake inputs, output function and module list:
|
example usage command: ``LD_PRELOAD=~/.local/lib/liblsfg-vk.so LSFG_DLL_PATH=<POINT_ME_TO>/Lossless.dll ENABLE_LSFG=1 vkcube``
|
||||||
```nix
|
|
||||||
inputs = {
|
|
||||||
...
|
|
||||||
lsfg-vk-flake.url = "github:pabloaul/lsfg-vk-flake/main";
|
|
||||||
lsfg-vk-flake.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
}
|
|
||||||
|
|
||||||
outputs = {nixpkgs, lsfg-vk-flake, ...}: {
|
|
||||||
|
|
||||||
nixosConfigurations.hostname = nixpkgs.lib.nixosSystem {
|
|
||||||
...
|
|
||||||
modules = [
|
|
||||||
...
|
|
||||||
lsfg-vk-flake.nixosModules.default
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
And then you should be able to enable this in your system config using:
|
|
||||||
```nix
|
|
||||||
services.lsfg-vk.enable = true;
|
|
||||||
|
|
||||||
# optional but recommended:
|
|
||||||
environment.variables = { LSFG_DLL_PATH = "<ABSOLUTE_PATH_TO>/Lossless.dll"; }
|
|
||||||
```
|
|
||||||
|
|
||||||
### User install (manual)
|
|
||||||
1. Build the library:
|
|
||||||
``nix build``
|
|
||||||
3. Create the following path in case it does not exist:
|
|
||||||
``mkdir -p $HOME/.local/share/vulkan/implicit_layer.d``
|
|
||||||
3. Symlink the build results to your $HOME/.local/
|
|
||||||
``cp -ifrsv "$(readlink -f ./result)"/* $HOME/.local/``
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
Run a Vulkan application with the environment variable ``ENABLE_LSFG=1`` set.
|
|
||||||
|
|
||||||
Example: ``ENABLE_LSFG=1 vkcube`` and look for output like this in the terminal: lsfg-vk(...): ...
|
|
||||||
|
|
||||||
You can also enable it per game on Steam by adding this to the launch options of a game like this:
|
|
||||||
``ENABLE_LSFG=1 %COMMAND%``
|
|
||||||
|
|
||||||
There are many more options that can be set. Consult the original repository for further documentation.
|
|
||||||
|
|
|
@ -10,13 +10,13 @@
|
||||||
|
|
||||||
in llvmPackages.stdenv.mkDerivation {
|
in llvmPackages.stdenv.mkDerivation {
|
||||||
pname = "lsfg-vk";
|
pname = "lsfg-vk";
|
||||||
version = "unstable-2025-07-14-83b869b";
|
version = "unstable-2025-07-13-f998647";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "PancakeTAS";
|
owner = "PancakeTAS";
|
||||||
repo = "lsfg-vk";
|
repo = "lsfg-vk";
|
||||||
rev = "83b869b0c4d4cd4da2e760126242c6ed76bafec8";
|
rev = "f998647d74051467e39de9de2df2ff9a5996db5f";
|
||||||
hash = "sha256-LN6DkLN6pMmYRaj+TsAL3PLqINMeYOhQ2Kw16bRF/Q4=";
|
hash = "sha256-X708aKFz3wqSVYsMvCKsY7kqi+2LTewnoOMrXFPVEPY=";
|
||||||
fetchSubmodules = true;
|
fetchSubmodules = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,5 @@
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
in {
|
in {
|
||||||
packages.${system}.default = pkgs.callPackage ./default.nix {};
|
packages.${system}.default = pkgs.callPackage ./default.nix {};
|
||||||
nixosModules.default = import ./module.nix;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
26
module.nix
26
module.nix
|
@ -1,26 +0,0 @@
|
||||||
{ config, lib, pkgs, ... }:
|
|
||||||
let
|
|
||||||
cfg = config.services.lsfg-vk;
|
|
||||||
lsfg-vk = pkgs.callPackage ./default.nix {};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options = {
|
|
||||||
services.lsfg-vk = {
|
|
||||||
enable = lib.mkEnableOption "Lossless Scaling Frame Generation Vulkan layer";
|
|
||||||
|
|
||||||
package = lib.mkOption {
|
|
||||||
type = lib.types.package;
|
|
||||||
description = "The lsfg-vk package to use";
|
|
||||||
default = lsfg-vk;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
environment.systemPackages = [ cfg.package ];
|
|
||||||
|
|
||||||
# Installs the Vulkan implicit layer system-wide
|
|
||||||
environment.etc."vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json".source =
|
|
||||||
"${cfg.package}/share/vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json";
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue