Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
977dd31
feat: add native Linux Vulkan support
TheForgotten69 Sep 2, 2026
275d3d8
fix: harden native Linux Vulkan runtime
TheForgotten69 Sep 2, 2026
9bdca35
fix: harden Linux Wayland input lifecycle
TheForgotten69 Sep 2, 2026
d1eb855
feat: configure default Linux effect paths
TheForgotten69 Sep 2, 2026
c8153f8
feat: add Vulkan depth access on Linux
TheForgotten69 Sep 3, 2026
bec8228
feat: load native Linux add-ons
TheForgotten69 Sep 3, 2026
658d6f9
feat: add Wayland relative pointer input
TheForgotten69 Sep 3, 2026
96e09e9
fix: polish Linux runtime integration
TheForgotten69 Sep 3, 2026
6bb652d
Merge pull request #2 from TheForgotten69/linux-depth
TheForgotten69 Sep 3, 2026
71a7fae
Merge branch 'main' into linux-vulkan
TheForgotten69 Sep 3, 2026
c08aa35
feat: build native Linux add-on examples
TheForgotten69 Sep 6, 2026
2e62524
feat: auto-detect reversed Vulkan depth convention
TheForgotten69 Sep 9, 2026
9e085f4
refactor: harden Linux Wayland input lifecycle
TheForgotten69 Sep 9, 2026
df91b51
feat: harden native Linux add-on loading and paths
TheForgotten69 Sep 9, 2026
f4951ee
release: add interactive Linux beta installer
TheForgotten69 Sep 10, 2026
4ccac41
release: select Linux add-ons from one menu
TheForgotten69 Sep 10, 2026
f6a2dc8
release: show Linux installation paths
TheForgotten69 Sep 10, 2026
3055f91
docs: explain Linux shader and add-on installation
TheForgotten69 Sep 10, 2026
8c6fd23
Merge branch 'main' into linux-vulkan
TheForgotten69 Sep 12, 2026
0a99e9a
Merge branch 'main' into linux-vulkan
TheForgotten69 Sep 12, 2026
1342769
Merge pull request #8 from TheForgotten69/linux-wine-input
TheForgotten69 Sep 30, 2026
4ed9ecb
Merge branch 'main' into linux-vulkan
TheForgotten69 Sep 30, 2026
6a68432
examples: guard D3D IUnknown release in generic depth for non-Windows…
TheForgotten69 Sep 30, 2026
51fbe22
linux: store configuration per game profile (#10)
TheForgotten69 Sep 30, 2026
76e263c
Linux overlay parity (#11)
TheForgotten69 Sep 30, 2026
31e366c
linux: support dead keys and compose sequences in overlay text input
TheForgotten69 Sep 30, 2026
0a67fd5
linux: build and test in CI, publish releases from tags
TheForgotten69 Sep 30, 2026
001c7bf
linux: install the Xlib headers in CI
TheForgotten69 Sep 30, 2026
f7a5fad
Use std::pow instead of std::powf
TheForgotten69 Sep 30, 2026
0db26b1
Use std::ceil instead of std::ceilf in the texture overlay example
TheForgotten69 Sep 30, 2026
4f71f8b
Lower add-on dispatch cost, fix depth detection and depth flicker (#12)
TheForgotten69 Oct 1, 2026
dd33c0a
Linux vulkan present flush (#13)
TheForgotten69 Oct 10, 2026
e8ee904
fix(vulkan): stop tracking and restoring application descriptor sets …
TheForgotten69 Oct 18, 2026
884167f
fix(vulkan): validate add-on swap chain overrides and stop leaking fo…
TheForgotten69 Oct 18, 2026
b5b78df
feat(vulkan): expose the WSI surface kind to add-ons (#15)
TheForgotten69 Oct 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: linux

on:
push:
branches:
- linux-vulkan
tags:
- 'v*-beta.*'
pull_request:
branches:
- linux-vulkan

permissions: {}

concurrency:
group: linux-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
build:
runs-on: ubuntu-24.04

permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
submodules: true

- name: Fetch upstream release tags
run: |
git fetch --no-tags https://github.com/crosire/reshade 'refs/tags/v*:refs/tags/v*'

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
cmake ninja-build pkg-config python3-jinja2 \
libwayland-dev wayland-protocols libxkbcommon-dev libfontconfig-dev \
libx11-dev libxcb1-dev libxcb-xinput-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-cursor-dev

- name: Determine archive name
id: version
run: |
echo "name=reshade-linux-vulkan-$(git describe --tags --match 'v[0-9]*')-x86_64" >> "$GITHUB_OUTPUT"

- name: Build
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DRESHADE_BUILD_LINUX_TESTS=ON -DRESHADE_BUILD_LINUX_ADDON_EXAMPLES=ON
cmake --build build

- name: Test
run: |
ctest --test-dir build --output-on-failure

- name: Package
run: |
git clone --depth 1 --branch slim https://github.com/crosire/reshade-shaders "$RUNNER_TEMP/reshade-shaders"
cmake --install build --prefix "$RUNNER_TEMP/stage"
tools/linux/package.sh "$RUNNER_TEMP/stage" "$RUNNER_TEMP/reshade-shaders" "${{ steps.version.outputs.name }}" dist

- name: Upload archive
uses: actions/upload-artifact@v7
with:
name: ${{ steps.version.outputs.name }}
path: dist/*.tar.xz

- name: Publish release
if: github.ref_type == 'tag'
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.ref_name }}
run: |
# The release notes are the message of the annotated tag
git fetch --force origin "refs/tags/$TAG:refs/tags/$TAG"
git for-each-ref --format='%(contents)' "refs/tags/$TAG" > "$RUNNER_TEMP/notes.md"
gh release create "$TAG" dist/*.tar.xz --verify-tag --prerelease --title "ReShade for native Linux $TAG" --notes-file "$RUNNER_TEMP/notes.md"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[Oo]bj/
[Ii]ntermediate/
[Bb]uild/
[Bb]uild-linux*/
[Dd]ebug/
[Rr]elease/
*.obj
Expand Down
86 changes: 52 additions & 34 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,12 @@ set(RESHADE_SOURCE_WINDOWS
source/windows/ws2_32.cpp
)

if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
include(cmake/reshade_linux.cmake)
elseif(NOT WIN32)
message(FATAL_ERROR "ReShade currently supports only Windows and Linux")
endif()

target_sources(
ReShade
PUBLIC
Expand All @@ -260,35 +266,40 @@ target_sources(
include/reshade_api_resource.hpp
include/reshade_events.hpp
include/reshade_overlay.hpp
PRIVATE
${RESHADE_SOURCE}
${RESHADE_SOURCE_OPENGL}
${RESHADE_SOURCE_VULKAN}
${RESHADE_SOURCE_DIRECTX}
${RESHADE_SOURCE_VR}
${RESHADE_SOURCE_WINDOWS}
)
if(WIN32)
target_sources(
ReShade
PRIVATE
${RESHADE_SOURCE}
${RESHADE_SOURCE_OPENGL}
${RESHADE_SOURCE_VULKAN}
${RESHADE_SOURCE_DIRECTX}
${RESHADE_SOURCE_VR}
${RESHADE_SOURCE_WINDOWS}
source/input_windows.cpp
source/input_windows_xinput.cpp
source/platform_utils_windows.cpp
)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
reshade_configure_linux_target(ReShade)
endif()

set_source_files_properties(source/input_windows_xinput.cpp PROPERTIES COMPILE_DEFINITIONS "$<IF:$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>,_AMD64_,_X86_>;_WIN32_WINNT=_WIN32_WINNT_WIN7")
if(WIN32)
set_source_files_properties(source/input_windows_xinput.cpp PROPERTIES COMPILE_DEFINITIONS "$<IF:$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>,_AMD64_,_X86_>;_WIN32_WINNT=_WIN32_WINNT_WIN7")
endif()
set_source_files_properties(source/vulkan/vulkan_impl_device.cpp PROPERTIES COMPILE_DEFINITIONS VMA_IMPLEMENTATION)

set_source_files_properties(examples/09-depth/generic_depth_addon.cpp PROPERTIES COMPILE_DEFINITIONS BUILTIN_ADDON)
set_source_files_properties(examples/15-effect_runtime_sync/runtime_sync_addon.cpp PROPERTIES COMPILE_DEFINITIONS BUILTIN_ADDON)
if(MSVC)
set_source_files_properties(examples/09-depth/generic_depth_addon.cpp PROPERTIES COMPILE_FLAGS /FIreshade.hpp)
set_source_files_properties(examples/15-effect_runtime_sync/runtime_sync_addon.cpp PROPERTIES COMPILE_FLAGS /FIreshade.hpp)
else()
set_source_files_properties(examples/09-depth/generic_depth_addon.cpp PROPERTIES COMPILE_FLAGS "-include reshade.hpp")
set_source_files_properties(examples/15-effect_runtime_sync/runtime_sync_addon.cpp PROPERTIES COMPILE_FLAGS "-include reshade.hpp")
if(WIN32)
set_source_files_properties(examples/09-depth/generic_depth_addon.cpp PROPERTIES COMPILE_DEFINITIONS BUILTIN_ADDON)
set_source_files_properties(examples/15-effect_runtime_sync/runtime_sync_addon.cpp PROPERTIES COMPILE_DEFINITIONS BUILTIN_ADDON)
if(MSVC)
set_source_files_properties(examples/09-depth/generic_depth_addon.cpp PROPERTIES COMPILE_FLAGS /FIreshade.hpp)
set_source_files_properties(examples/15-effect_runtime_sync/runtime_sync_addon.cpp PROPERTIES COMPILE_FLAGS /FIreshade.hpp)
else()
set_source_files_properties(examples/09-depth/generic_depth_addon.cpp PROPERTIES COMPILE_FLAGS "-include reshade.hpp")
set_source_files_properties(examples/15-effect_runtime_sync/runtime_sync_addon.cpp PROPERTIES COMPILE_FLAGS "-include reshade.hpp")
endif()
endif()

target_include_directories(
Expand All @@ -298,21 +309,23 @@ target_include_directories(
source
)

target_compile_definitions(
ReShade
PRIVATE
RESHADE_GUI
RESHADE_API_LIBRARY_EXPORT
RESHADE_ADDON=2
$<$<CXX_COMPILER_ID:MSVC>:RESHADE_LOCALIZATION>
$<$<CONFIG:Debug>:RESHADE_VERBOSE_LOG>
_GDI32_
WINSOCK_API_LINKAGE=
_UNICODE
_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS
$<$<CONFIG:Debug>:_DEBUG>
$<$<CONFIG:Release>:NDEBUG>
)
if(WIN32)
target_compile_definitions(
ReShade
PRIVATE
RESHADE_GUI
RESHADE_API_LIBRARY_EXPORT
RESHADE_ADDON=2
$<$<CXX_COMPILER_ID:MSVC>:RESHADE_LOCALIZATION>
$<$<CONFIG:Debug>:RESHADE_VERBOSE_LOG>
_GDI32_
WINSOCK_API_LINKAGE=
_UNICODE
_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS
$<$<CONFIG:Debug>:_DEBUG>
$<$<CONFIG:Release>:NDEBUG>
)
endif()

if(MSVC)
target_compile_options(
Expand All @@ -335,13 +348,18 @@ else()
ReShade
PRIVATE
-DSTDMETHODCALLTYPE=
-Wno-changes-meaning
$<$<COMPILE_LANGUAGE:CXX>:-Wno-changes-meaning>
-fPIC
$<$<CONFIG:Release>:-fno-rtti>
$<$<AND:$<CONFIG:Release>,$<COMPILE_LANGUAGE:CXX>>:-fno-rtti>
)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64|amd64)$")
target_compile_options(ReShade PRIVATE -msse4.1 -mf16c)
endif()
endif()

target_link_libraries(ReShade PRIVATE ReShadeFX D3D12On7 fpng glad ImGui jxl MinHook OpenVR OpenXR stb utfcpp VMA Windows)
if(WIN32)
target_link_libraries(ReShade PRIVATE ReShadeFX D3D12On7 fpng glad ImGui jxl MinHook OpenVR OpenXR stb utfcpp VMA Windows)
endif()

# ReShade FX

Expand Down
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ The ReShade FX shader compiler contained in this repository is standalone, so ca

## Building

### Windows

You'll need Visual Studio 2017 or higher to build ReShade. And Python in the PATH environment variable for the `glad` dependency to build.

1. Clone this repository including all Git submodules\
Expand All @@ -17,6 +19,48 @@ You'll need Visual Studio 2017 or higher to build ReShade. And Python in the PAT
3. Select either the `32-bit` or `64-bit` target platform and build the solution.\
This will build ReShade and all dependencies. To build the setup tool, first build the `Release` configuration for both `32-bit` and `64-bit` targets and only afterwards build the `Release Setup` configuration (does not matter which target is selected then).

### Linux

The native Linux build supports x86-64 Vulkan applications running on Wayland, native X11, or XWayland, plus experimental Wine/Proton hosts. The input backend is selected per window from the Vulkan presentation surface's actual WSI kind, not from `$XDG_SESSION_TYPE`. It requires CMake, a C++17 compiler, Python, pkg-config, and the development packages for Wayland client, Wayland protocols, xkbcommon, Xlib, XCB (including `xcb-xinput`, `xcb-xfixes` and `xcb-cursor`), and Fontconfig.

```sh
cmake -S . -B build-linux -DRESHADE_VERSION=<major.minor.patch>
cmake --build build-linux
cmake --install build-linux --prefix "$HOME/.local"
```

The version option is only needed when the source tree has no reachable ReShade version tag. The install registers an opt-in Vulkan implicit layer. Launch an application with `RESHADE_ENABLE=1`, for example:

```sh
RESHADE_ENABLE=1 /path/to/application
```

For a Steam game using a Proton build with native Wayland support, use this launch option:

```sh
RESHADE_ENABLE=1 PROTON_ENABLE_WAYLAND=1 %command%
```

Configuration is stored below the XDG config directory (normally `~/.config/reshade`), and logs below `$XDG_DATA_HOME/reshade/logs` (normally `~/.local/share/reshade/logs`). Generic Depth and Effect Runtime Sync are built in. Native Linux `.addon` and `.addon64` libraries are loaded from the user's XDG data directory and the installation's share directory; user copies take precedence by filename. Setting `[ADDON] AddonPath` explicitly restricts discovery to that directory. Windows add-on binaries are listed as incompatible and are not loaded.

Configure with `-DRESHADE_BUILD_LINUX_ADDON_EXAMPLES=ON` to build the portable example add-ons. Generic Depth and Effect Runtime Sync are also built as standalone examples, but are not installed again because they are built into the host. Video capture requires FFmpeg development packages, and ray tracing requires DXC. These examples retain their individual behavior: Texture Replace reads `texreplace` beside the executable; shader/texture dumps and shader replacements use the user's ReShade data directory.

To produce a distributable Linux archive with the optional example add-ons, configure that option and run `tools/package_linux.sh <build-dir> <official-reshade-shaders-checkout> [output-dir] [version]`. The archive installer installs no optional add-ons unless the user selects them interactively (or sets `INSTALL_ADDONS` for an unattended installation), so a fresh install does not activate development tools by default.

The Linux port does not support Windows add-on binaries, OpenGL injection, VR overlays, gamepad navigation, screenshot sounds, or automatic update checks. Input is read passively through a private Wayland event queue, non-exclusive XInput2 raw events on X11/XWayland, or Wine's dynamically discovered `win32u` input bridge. It does not use an invasive global X11 grab, so native applications may continue receiving mouse and keyboard input while the overlay is open. A configured screenshot post-save command is run as `/bin/sh -c <command>` in a detached, non-blocking process. FFmpeg-dependent add-ons may require compatible system libraries when the application bundles its own dependencies.

On Linux/Vulkan, Generic Depth can infer normal versus reversed depth from matching clear values and depth-test comparisons for the selected buffer. It observes at most 600 rendered frames and requires 120 consecutive matching observations before applying a result. Missing or conflicting evidence leaves the setting unchanged. No GPU readback is used. An explicit `RESHADE_DEPTH_INPUT_IS_REVERSED` definition takes precedence; automatic results are saved in the active preset, so use separate presets for games with different depth conventions. DisplayDepth's live-preview controls do not change other effects' preprocessor definitions.

Automatic depth-convention detection is best-effort and can be disabled with `AutoDetectReversedDepth=0` in the `[DEPTH]` section of `ReShade.ini`. It applies at most once per runtime; removing a saved definition and restarting the application allows a new detection attempt. It does not detect logarithmic depth or other custom depth encodings.

Linux portability regression tests can be run without a game or compositor:

```sh
cmake -S . -B build-linux -DRESHADE_BUILD_LINUX_TESTS=ON
cmake --build build-linux --target reshade_linux_tests
ctest --test-dir build-linux --output-on-failure
```

A quick overview of what some of the source code files contain:

|File |Description |
Expand Down
Loading
Loading