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. "main" and "unstable-2025-07-19-dd5190a" have entirely different histories.
main
...
unstable-2
7 changed files with 112 additions and 185 deletions
39
README.md
39
README.md
|
@ -9,7 +9,7 @@ Nix flake for using [Lossless Scaling's frame generation on Linux](https://githu
|
||||||
### System-wide (NixOS module)
|
### System-wide (NixOS module)
|
||||||
This approach will install an implicit layer to ``/etc/vulkan/implicit_layer.d/``
|
This approach will install an implicit layer to ``/etc/vulkan/implicit_layer.d/``
|
||||||
|
|
||||||
Add this to your flake inputs, output function and modules list:
|
Add this repository to your flake inputs, output function and module list:
|
||||||
```nix
|
```nix
|
||||||
inputs = {
|
inputs = {
|
||||||
...
|
...
|
||||||
|
@ -29,42 +29,25 @@ outputs = {nixpkgs, lsfg-vk-flake, ...}: {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
And then enable this in your system config:
|
And then you should be able to enable this in your system config using:
|
||||||
```nix
|
```nix
|
||||||
services.lsfg-vk = {
|
services.lsfg-vk.enable = true;
|
||||||
enable = true;
|
|
||||||
ui.enable = true; # installs gui for configuring lsfg-vk
|
|
||||||
};
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### User install (manual)
|
### User install (manual)
|
||||||
1. Build the library:
|
1. Build the library:
|
||||||
```bash
|
``nix build``
|
||||||
nix build
|
3. Create the following path in case it does not exist:
|
||||||
```
|
``mkdir -p $HOME/.local/share/vulkan/implicit_layer.d``
|
||||||
2. Create the following path in case it does not exist:
|
|
||||||
```bash
|
|
||||||
mkdir -p $HOME/.local/share/vulkan/implicit_layer.d
|
|
||||||
```
|
|
||||||
3. Symlink the build results to your $HOME/.local/
|
3. Symlink the build results to your $HOME/.local/
|
||||||
```bash
|
``cp -ifrsv "$(readlink -f ./result)"/* $HOME/.local/``
|
||||||
cp -ifrsv "$(readlink -f ./result)"/* $HOME/.local/
|
|
||||||
```
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
Run a Vulkan application with the environment variable ``ENABLE_LSFG=1`` set.
|
Run a Vulkan application with the environment variable ``ENABLE_LSFG=1`` set.
|
||||||
|
|
||||||
Example:
|
Example: ``ENABLE_LSFG=1 vkcube`` and look for output like this in the terminal: lsfg-vk(...): ...
|
||||||
```bash
|
|
||||||
ENABLE_LSFG=1 vkcube
|
|
||||||
```
|
|
||||||
|
|
||||||
To confirm that it is working, 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%``
|
||||||
|
|
||||||
You can also enable it per game on Steam by adding this to the launch options:
|
There are many more options that can be set. Consult the original repository for further documentation.
|
||||||
```
|
|
||||||
ENABLE_LSFG=1 %COMMAND%
|
|
||||||
```
|
|
||||||
|
|
||||||
>[!NOTE]
|
|
||||||
> If the environment variable is set but the program doesn't show any lsfg-vk output, you may need to add the application to your lsfg-vk configuration file at `~/.config/lsfg-vk/config.toml`. Read more about it in the [Wiki](https://github.com/PancakeTAS/lsfg-vk/wiki/Configuring-lsfg-vk)
|
|
69
default.nix
Normal file
69
default.nix
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
fetchFromGitHub,
|
||||||
|
cmake,
|
||||||
|
ninja,
|
||||||
|
vulkan-headers,
|
||||||
|
vulkan-loader,
|
||||||
|
llvmPackages,
|
||||||
|
spirv-headers,
|
||||||
|
libX11,
|
||||||
|
libXrandr,
|
||||||
|
libXinerama,
|
||||||
|
libXcursor,
|
||||||
|
libXi,
|
||||||
|
libglvnd,
|
||||||
|
libxkbcommon,
|
||||||
|
wayland-scanner,
|
||||||
|
pkg-config,
|
||||||
|
wayland,
|
||||||
|
}:
|
||||||
|
|
||||||
|
llvmPackages.stdenv.mkDerivation {
|
||||||
|
pname = "lsfg-vk";
|
||||||
|
version = "unstable-2025-07-19-dd5190a";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "PancakeTAS";
|
||||||
|
repo = "lsfg-vk";
|
||||||
|
rev = "dd5190aa680a7543143e724a100bd5d6e9898dd7";
|
||||||
|
hash = "sha256-2WrUtjUG8l3tSElDYfhvi4lrFUG1Oh5M7DAEX2mFh5s=";
|
||||||
|
fetchSubmodules = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
cmakeFlags = [
|
||||||
|
"-DCMAKE_BUILD_TYPE=Release"
|
||||||
|
];
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
# clang-tools needs to come before clang so it can locate Vulkan headers correctly
|
||||||
|
llvmPackages.clang-tools
|
||||||
|
llvmPackages.clang
|
||||||
|
llvmPackages.libllvm # needed for release builds
|
||||||
|
cmake
|
||||||
|
ninja
|
||||||
|
wayland-scanner
|
||||||
|
pkg-config
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
vulkan-headers
|
||||||
|
vulkan-loader
|
||||||
|
spirv-headers
|
||||||
|
libX11
|
||||||
|
libXrandr
|
||||||
|
libXinerama
|
||||||
|
libXcursor
|
||||||
|
libXi
|
||||||
|
libglvnd
|
||||||
|
libxkbcommon
|
||||||
|
wayland
|
||||||
|
];
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "Vulkan layer for frame generation (Requires Lossless Scaling install)";
|
||||||
|
homepage = "https://github.com/PancakeTAS/lsfg-vk/";
|
||||||
|
license = licenses.mit;
|
||||||
|
platforms = platforms.linux;
|
||||||
|
};
|
||||||
|
}
|
6
flake.lock
generated
6
flake.lock
generated
|
@ -2,11 +2,11 @@
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1756266583,
|
"lastModified": 1751792365,
|
||||||
"narHash": "sha256-cr748nSmpfvnhqSXPiCfUPxRz2FJnvf/RjJGvFfaCsM=",
|
"narHash": "sha256-J1kI6oAj25IG4EdVlg2hQz8NZTBNYvIS0l4wpr9KcUo=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "8a6d5427d99ec71c64f0b93d45778c889005d9c2",
|
"rev": "1fd8bada0b6117e6c7eb54aad5813023eed37ccb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
10
flake.nix
10
flake.nix
|
@ -3,15 +3,11 @@
|
||||||
|
|
||||||
outputs = { nixpkgs, ... }:
|
outputs = { nixpkgs, ... }:
|
||||||
let
|
let
|
||||||
forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ];
|
system = "x86_64-linux";
|
||||||
|
pkgs = import nixpkgs { inherit system; };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
packages = forAllSystems (system: {
|
packages.${system}.default = pkgs.callPackage ./default.nix { };
|
||||||
default = nixpkgs.legacyPackages.${system}.callPackage ./lsfg-vk.nix { };
|
|
||||||
lsfg-vk = nixpkgs.legacyPackages.${system}.callPackage ./lsfg-vk.nix { };
|
|
||||||
lsfg-vk-ui = nixpkgs.legacyPackages.${system}.callPackage ./lsfg-vk-ui.nix { };
|
|
||||||
});
|
|
||||||
|
|
||||||
nixosModules.default = import ./module.nix;
|
nixosModules.default = import ./module.nix;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,54 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
fetchFromGitHub,
|
|
||||||
rustPlatform,
|
|
||||||
pkg-config,
|
|
||||||
glib,
|
|
||||||
pango,
|
|
||||||
gdk-pixbuf,
|
|
||||||
gtk4,
|
|
||||||
libadwaita,
|
|
||||||
}:
|
|
||||||
|
|
||||||
rustPlatform.buildRustPackage rec {
|
|
||||||
pname = "lsfg-vk-ui";
|
|
||||||
version = "1.0.0";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "PancakeTAS";
|
|
||||||
repo = "lsfg-vk";
|
|
||||||
tag = "v${version}";
|
|
||||||
hash = "sha256-nIyVOil/gHC+5a+sH3vMlcqVhixjJaGWqXbyoh2Nqyw=";
|
|
||||||
};
|
|
||||||
|
|
||||||
cargoHash = "sha256-hIQRS/egIDU5Vu/1KWHtpt4S26h+9GadVr+lBAG2LDg=";
|
|
||||||
|
|
||||||
sourceRoot = "source/ui";
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
pkg-config
|
|
||||||
glib
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
pango
|
|
||||||
gdk-pixbuf
|
|
||||||
gtk4
|
|
||||||
libadwaita
|
|
||||||
];
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
install -Dm444 $src/ui/rsc/gay.pancake.lsfg-vk-ui.desktop $out/share/applications/gay.pancake.lsfg-vk-ui.desktop
|
|
||||||
install -Dm444 $src/ui/rsc/icon.png $out/share/icons/hicolor/256x256/apps/gay.pancake.lsfg-vk-ui.png
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "Graphical configuration interface for lsfg-vk";
|
|
||||||
homepage = "https://github.com/PancakeTAS/lsfg-vk/";
|
|
||||||
changelog = "https://github.com/PancakeTAS/lsfg-vk/releases/tag/${src.tag}";
|
|
||||||
license = lib.licenses.mit;
|
|
||||||
platforms = lib.platforms.linux;
|
|
||||||
maintainers = with lib.maintainers; [ pabloaul ];
|
|
||||||
mainProgram = "lsfg-vk-ui";
|
|
||||||
};
|
|
||||||
}
|
|
44
lsfg-vk.nix
44
lsfg-vk.nix
|
@ -1,44 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
fetchFromGitHub,
|
|
||||||
cmake,
|
|
||||||
vulkan-headers,
|
|
||||||
llvmPackages,
|
|
||||||
}:
|
|
||||||
|
|
||||||
llvmPackages.stdenv.mkDerivation rec {
|
|
||||||
pname = "lsfg-vk";
|
|
||||||
version = "1.0.0";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "PancakeTAS";
|
|
||||||
repo = "lsfg-vk";
|
|
||||||
tag = "v${version}";
|
|
||||||
hash = "sha256-hWpuPH7mKbeMaLaRUwtlkNLy4lOnJEe+yd54L7y2kV0=";
|
|
||||||
fetchSubmodules = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
substituteInPlace VkLayer_LS_frame_generation.json \
|
|
||||||
--replace-fail "liblsfg-vk.so" "$out/lib/liblsfg-vk.so"
|
|
||||||
'';
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
llvmPackages.clang-tools
|
|
||||||
llvmPackages.libllvm
|
|
||||||
cmake
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
vulkan-headers
|
|
||||||
];
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "Vulkan layer for frame generation (Requires owning Lossless Scaling)";
|
|
||||||
homepage = "https://github.com/PancakeTAS/lsfg-vk/";
|
|
||||||
changelog = "https://github.com/PancakeTAS/lsfg-vk/releases/tag/${src.tag}";
|
|
||||||
license = lib.licenses.mit;
|
|
||||||
platforms = lib.platforms.linux;
|
|
||||||
maintainers = with lib.maintainers; [ pabloaul ];
|
|
||||||
};
|
|
||||||
}
|
|
41
module.nix
41
module.nix
|
@ -6,23 +6,23 @@
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.services.lsfg-vk;
|
cfg = config.services.lsfg-vk;
|
||||||
lsfg-vk = pkgs.callPackage ./lsfg-vk.nix { };
|
lsfg-vk = pkgs.callPackage ./default.nix { };
|
||||||
lsfg-vk-ui = pkgs.callPackage ./lsfg-vk-ui.nix { };
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
services.lsfg-vk = {
|
services.lsfg-vk = {
|
||||||
enable = lib.mkEnableOption "Lossless Scaling Frame Generation Vulkan layer";
|
enable = lib.mkEnableOption "Lossless Scaling Frame Generation Vulkan layer";
|
||||||
|
|
||||||
ui.enable = lib.mkEnableOption "Enables a GUI for configuring lsfg-vk";
|
|
||||||
|
|
||||||
package = lib.mkOption {
|
package = lib.mkOption {
|
||||||
type = lib.types.package;
|
type = lib.types.package;
|
||||||
description = "The lsfg-vk package to use";
|
description = "The lsfg-vk package to use";
|
||||||
default = lsfg-vk;
|
default = lsfg-vk;
|
||||||
};
|
};
|
||||||
|
|
||||||
losslessDLLFile = lib.mkOption {
|
losslessDLLFile =
|
||||||
|
lib.warn "losslessDLLFile is deprecated and will only be used by lsfg-vk if LSFG_LEGACY is set."
|
||||||
|
lib.mkOption
|
||||||
|
{
|
||||||
type = with lib.types; nullOr str;
|
type = with lib.types; nullOr str;
|
||||||
default = null;
|
default = null;
|
||||||
example = "/home/user/games/Lossless Scaling/Lossless.dll";
|
example = "/home/user/games/Lossless Scaling/Lossless.dll";
|
||||||
|
@ -31,39 +31,16 @@ in
|
||||||
Required if Lossless Scaling isn't installed in a standard location
|
Required if Lossless Scaling isn't installed in a standard location
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
configFile = lib.mkOption {
|
|
||||||
type = with lib.types; nullOr str;
|
|
||||||
default = null;
|
|
||||||
example = "/home/user/.config/lsfg-vk/conf.toml";
|
|
||||||
description = ''
|
|
||||||
Sets the LSFG_CONFIG environment variable.
|
|
||||||
Required if the lsfg-vk configuration file isn't stored at the standard location
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable (
|
config = lib.mkIf cfg.enable {
|
||||||
lib.mkMerge [
|
|
||||||
{
|
|
||||||
environment.systemPackages = [ cfg.package ];
|
environment.systemPackages = [ cfg.package ];
|
||||||
|
|
||||||
# Installs the Vulkan implicit layer system-wide
|
# Installs the Vulkan implicit layer system-wide
|
||||||
environment.etc."vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json".source =
|
environment.etc."vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json".source =
|
||||||
"${cfg.package}/share/vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json";
|
"${cfg.package}/share/vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json";
|
||||||
}
|
|
||||||
(lib.mkIf cfg.ui.enable {
|
environment.sessionVariables.LSFG_DLL_PATH = lib.mkIf (cfg.losslessDLLFile != null) cfg.losslessDLLFile;
|
||||||
environment.systemPackages = [ lsfg-vk-ui ];
|
};
|
||||||
})
|
|
||||||
(lib.mkIf (cfg.losslessDLLFile != null) {
|
|
||||||
environment.sessionVariables.LSFG_DLL_PATH =
|
|
||||||
lib.warn "losslessDLLFile is deprecated and will only be used by lsfg-vk if LSFG_LEGACY is set."
|
|
||||||
cfg.losslessDLLFile;
|
|
||||||
})
|
|
||||||
(lib.mkIf (cfg.configFile != null) {
|
|
||||||
environment.sessionVariables.LSFG_CONFIG = cfg.configFile;
|
|
||||||
})
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue