Backends: Win32: Optimized the Gamepad input processing part#8556
Backends: Win32: Optimized the Gamepad input processing part#8556MidTerm-CN wants to merge 1 commit intoocornut:masterfrom
Conversation
|
Hello, Thanks for the PR. I am not sure this would be meaningful optimization given the added complexity. Did you profile the code to measure how much there was to gain? AddInputEvent() already does a backward search for the value. However the |
…acket number has not changed. (#8556) To be honest I don't believe this is valuable as an optimization, but it makes debug stepping a little nicer.
|
I have pushed the |
|
I have reverted this change with 0ba9fed. |
|
Reimplemented as 960aff2 |
According to the official documentation of Xinput, I found that there is code that can be optimized and done.
The point of the optimization is that there is no need to add events when there is no Gamepad input, and the new code does not add events for unupdated data
Document: https://learn.microsoft.com/en-us/windows/win32/api/XInput/ns-xinput-xinput_state