rpcs3/rpcs3/gamemode_control.cpp
ADAS2024 ef566186be
[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
2025-07-06 11:50:03 +02:00

25 lines
487 B
C++

#include "gamemode_control.h"
#ifdef GAMEMODE_AVAILABLE
#pragma GCC diagnostic ignored "-Wold-style-cast"
extern "C" {
#include "3rdparty/feralinteractive/feralinteractive/lib/gamemode_client.h"
}
#endif
// Enables and Disables GameMode based on user settings and system
void enable_gamemode([[maybe_unused]] bool enabled)
{
#if defined(GAMEMODE_AVAILABLE)
// Enable and Disable Gamemode
if (enabled)
{
gamemode_request_start();
}
else
{
gamemode_request_end();
}
#endif
}