-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
There was already a ticket about a similar issue but it was closed #4376
I have a Razer Viper 8Khz and when playing CS2, the game gets very laggy on Windows when moving the mouse. This does not happen when playing on the Linux version of CS2.
I think this is because SDL is using GetRawInputData, this is known to not work properly with mice that have a high polling rate. GetRawInputData is acquiring a lock on every call, and this causes significant performance loss because a high number of calls are needed when there is a high polling rate.
The way to fix this issue would be to use GetRawInputBuffer https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getrawinputbuffer which can retrieves multiple input events at once.
Valorant had the same issue (they were using GetRawInputData), and they later added a game setting called "Raw Input Buffer" to make use of GetRawInputBuffer, and it fixes this same issue.
See here for more information https://www.reddit.com/r/VALORANT/comments/r5w10e/comment/hmplvwh/?utm_source=reddit&utm_medium=web2x&context=3
https://www.thespike.gg/valorant/tips/what-is-raw-input-buffer-in-valorant
It has also became the default setting in Valorant.
EDIT: Also, the Unity game engine was affected by the same issue. More information here:
https://forum.unity.com/threads/windows-mouse-raw-input-mouse-handling-broken-in-rewired.1172786/#post-7514816