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
The function event_strcmp_events was previously returning int values
(-1, 0, 1) to indicate ordering. While this may resemble strcmp-like
semantics, it is invalid when used as a comparator with std::sort.
According to the C++ standard, the comparator used in standard
algorithms must be a function object returning a value contextually
convertible to bool, where comp(a, b) returns true if and only if a is
considered less than b.
Returning -1, 0, or 1 violates these rules. In particular, std::sort()
only expects the comparator to return a boolean value, and it uses that
value to infer ordering. Returning an int may lead to incorrect sorting
behavior and undefined behavior, including segmentation faults.
Replace the int-style comparator with a strict boolean comparison to
comply with the standard and ensure sorting correctness.
- The pointer-based nature of write entries, changes invalidate previous data
- Instead of managing scratch, just push to the descriptors built-in management which is quite optimal