[Linux] Implement Feral Interactive's Gamemode for Potential Performance Increases (#17325)

Currently, this is a draft PR to implement Feral Interactive's Gamemode
into RPCS3, which can improve game performance on certain Linux systems.

At the moment, I am running into various compiler warnings when trying
to include "gamemode_client.h" due to the file not using strict typings
and old C-style casts. I know I can disable these flags during RPCS3's
compilation but I wanted to check with the maintainers before going
forward and if this feature should be implemented.

It should be noted that RPCS3 only fails to compile and run if I include
Feral's header file, but everything else compiles if I comment out the
include.

Targets Issue #11299
This commit is contained in:
ADAS2024
2025-07-06 05:50:03 -04:00
committed by GitHub
parent 46150322a3
commit ef566186be
17 changed files with 102 additions and 1 deletions

View File

@@ -152,6 +152,15 @@ if(NOT WIN32)
add_compile_options(-pthread)
endif()
## Look for Gamemode if its installed on Linux
if(LINUX)
find_program(GAMEMODE_FOUND gamemoded) ## Only works if gamemode is installed on system (might include lib32 case)
if(GAMEMODE_FOUND)
add_compile_definitions(GAMEMODE_AVAILABLE)
endif()
message(GAMEMODE_AVAILABLE="${GAMEMODE_AVAILABLE}")
endif()
# TODO: do real installation, including copying directory structure
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${PROJECT_BINARY_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${PROJECT_BINARY_DIR}/bin")