-
-
Notifications
You must be signed in to change notification settings - Fork 118
Configuring lsfg‐vk
Note
Sorry in advance! An easy-to-use GUI is in the works but will take a while to complete. If you want to mostly replicate the old behavior, read the LSFG_PROCESS section carefully.
lsfg-vk is configured via ~/.config/lsfg-vk/conf.toml. Open it up in your favorite text editor. The configuration should look something like this:
version = 1
[global]
# override the location of Lossless Scaling
# dll = "/games/Lossless Scaling"
# [[game]] # example entry
# exe = "Game.exe"
# env = "SteamDeck=0"
#
# multiplier = 3
# flow_scale = 0.7
# performance_mode = true
# hdr_mode = false
#
# experimental_present_mode = fifo
# experimental_fps_limit = 48
[[game]] # default vkcube entry
exe = "vkcube"
multiplier = 4
performance_mode = true
[[game]] # default benchmark entry
exe = "benchmark"
multiplier = 4
performance_mode = false
[[game]] # override Genshin Impact
exe = "Genshin"
multiplier = 3You can override the path to the configuration with the environment variable LSFG_CONFIG.
The configuration is split into sections. You have a [global] section at the top, followed by as many [[game]] sections as you wish (note the double brackets).
The global section is used for setting up the layer as a whole. These are the properties you can set there:
| Property | Recommended Value | Description |
|---|---|---|
dll |
Path to Lossless.dll or empty |
If you didn't install Lossless Scaling into traditional directories, you can override the path to the Lossless.dll file within the game files using this property |
The game section is where stuff gets interesting:
| Property | Recommended Value | Description |
|---|---|---|
env |
Set additional environment variables using this format: VARIABLE='long value' ALSOVARIABLE=2
|
|
multiplier |
(1, )2, 3, 4 | Double, triple or quadruple your FPS. You can go as high as you want. |
flow_scale |
0.25 to 1.0 | Lowers the resolution of the internal image used for motion estimation. This can improve performance, although performance_mode is preferred. |
performance_mode |
true or false
|
Switches the frame generation model to much lighter one. This can massively improve performance (between 2x to 8x as fast, depending on the resolution). Loses a slight bit of quality |
hdr_mode |
1 when using HDR | Switches the shaders to HDR mode (scRGB not supported). Do NOT set this flag when not using HDR |
experimental_present_mode |
vsync/fifo or mailbox or immediate
|
Overrides the present mode without altering synchronization logic. Very experimental. |
experimental_fps_limit |
Try to override the FPS limit on DXVK and VKD3D games BEFORE applying lsfg-vk |
In addition to the above properties, each [[game]] section additionaly has the exe property, which might be a little bit confusing to newcomers. The exe property is matched against the end of the running program's path, or the command name. If you run vkcube, then the path will likely be /usr/bin/vkcube and the command name vkcube. You can now decide to set exe to vkcube (exact match with the command name) or something like bin/vkcube (matches the end of the path).
Why is this necessary? When you launch an app through wine/proton, the path will be /usr/bin/something/wine and NOT the actual game. This is why you need the game's command name.
Open up your game in the background. Then open a terminal and paste this command into it. To the right of the colon will be the command name, you should see your game in here.
for pid in /proc/[0-9]*; do
owner=$(stat -c %U "$pid" 2>/dev/null)
if [[ "$owner" == "$USER" ]]; then
if grep -qi 'vulkan' "$pid/maps" 2>/dev/null; then
procname=$(cat "$pid/comm" 2>/dev/null)
if [[ -n "$procname" ]]; then
printf "PID %s: %s\n" "$(basename "$pid")" "$procname"
fi
fi
fi
doneIf this is too complicated for you, set exe to whatever you like and launch the game with LSFG_PROCESS=<the name you gave it> (...). Note that this solution is much less convenient as it requires editing the launch arguments.
Almost every flag can be hot-reloaded, meaning you can edit the file while the game is running and it will apply instantly. As long as you have an entry in the configuration at the time of launching the game, it will work just fine. The experimental flag experimental_fps_limit is not hot-reloadable, simply due to how DXVK works. Obviously env can also not be hot-reloaded.
Setting multiplier to 1 temporarily disables lsfg-vk.
You should now know everything you need to use lsfg-vk. Check out these two pages if you want to know more:
If you're encountering issues with lsfg-vk in certain games, take a look at these pages:
If you're still getting used to the config system, or prefer the old system for some reasons, make these quick adjustment to get your old launch script to work.
Replace ENABLE_LSFG=1 with LSFG_LEGACY=1, which will disable the configuration system and switch to legacy environment variables.
If you've used the mesa flag to override the present mode, no need, you can use LSFG_EXPERIMENTAL_PRESENT_MODE=fifo/vsync/immediate/mailbox now.
If you've used DXVK_FRAME_RATE to limit your framerate, you can now use LSFG_EXPERIMENTAL_FPS_LIMIT instead.
And for completeness sake, LSFG_ENV can also be used.
Getting started:
Troubleshooting & More:
How lsfg-vk works: