-
-
Notifications
You must be signed in to change notification settings - Fork 82
Building from source
This guide provides instructions for building lsfg-vk from source for development and debugging. It is generally not recommended to build lsfg-vk yourself unless absolutely necessary. The instructions provided here should work for most Linux distributions.
Before compiling, you must install the required packages for your specific distribution.
Important
Steam Deck users need to disable the read-only protection and reinstall certain system packages first:
sudo steamos-readonly disable
sudo pacman-key --init
sudo pacman-key --populate
sudo pacman -Syy
sudo pacman -S linux-headers linux-api-headers glibcRefer to the table below for the packages you need to install.
| Component | Debian/Ubuntu | Arch Linux | Fedora |
|---|---|---|---|
| Build tools | build-essential | base-devel | @development-tools |
| Git | git | git | git |
| Clang/LLVM | clang llvm | clang llvm | clang llvm |
| Rustup | rustup | rustup | rustup |
| CMake | cmake | cmake | cmake |
| Ninja | ninja-build | ninja | ninja-build |
| Vulkan headers | libvulkan-dev | vulkan-headers | vulkan-headers |
| Vulkan loader | (included in headers) | vulkan-icd-loader | vulkan-loader-devel |
| GTK4 | libgtk-4-dev | gtk4 | gtk4-devel |
| libadwaita | libadwaita-1-dev | libadwaita | libadwaita-devel |
Note: Package names may vary depending on your distribution version.
The build process is the same for all distributions.
- Clone the Repository:
git clone --recurse-submodules [https://github.com/PancakeTAS/lsfg-vk.git](https://github.com/PancakeTAS/lsfg-vk.git)
cd lsfg-vk
git switch release # you may specify another branch you wish to build here - Build the project:
The recommended way to build and install lsfg-vk is this:
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=On
cmake --build buildHowever you may choose to change the following CMake variables:
| CMake Variable | Recommended Value | Description | Requirement |
|---|---|---|---|
| CMAKE_INSTALL_PREFIX | Changes where lsfg-vk is installed to, defaults to /usr/local. |
Optional | |
| CMAKE_BUILD_TYPE | Release | Setting this to "Debug" disables compiler optimization and embeds debug symbols | Required |
| CMAKE_(C/CXX)_COMPILER | clang/clang++ | Can be used to override the compiler and is a prerequisite for excess debug and LTO | Optional |
| CMAKE_INTERPROCEDURAL_OPTIMIZATION | On | Enables link-time optimization (LTO). Causes issues in GCC and is only recommended on clang | Optional |
| LSFGVK_EXCESS_DEBUG | Enables a bunch of debug flags only really needed for development | Optional |
- Install the project:
sudo cmake --install buildUnless overriden, this will install to /usr/local/lib and /usr/local/share/vulkan/implicit_layer.d
After installing lsfg-vk, you need to update the Vulkan implicit layer configuration file to point to the correct library path.
Open /usr/share/vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json and change liblsfg-vk.so to /usr/local/lib/liblsfg-vk.so.
Steam Deck users may choose to re-enable the read-only protection using this command:
sudo steamos-readonly enableNote
This will not place any desktop files or icons. Use prebuilt images if you require those.
To build and install the graphical configuration editor lsfg-vk-ui, run the following commands from the ui directory inside of the repository:
rustup default stable
cargo build --release
sudo cp -v ./target/release/lsfg-vk-ui /usr/local/bin/lsfg-vk-uiGetting started:
Troubleshooting & More:
How lsfg-vk works: