This fixes a performance regression introduced during state redesign shortly after Wine 5.0.
Some games create a great amount of lights (around 1000 and growing) and touch them quite often. That results in each light being relayed to CS thread before each draw which is taking a great amount of time (performance drop in Nosferatu: The Wrath of Malachi from ~150 fps to ~10-15 at start location; that's with another unrelated regression related to streaming buffer management sorted out).
It is also possible to use bitmasks like for other states, but then with these lights amount even iterating over the full set of lights during stateblock apply leads to noticable performance drop.
With this patchset Nosferatu reaches ~180 fps on the same place (~115 on Windows on the same machine, with the difference being probably due to SWVP).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2833
call_user_exception_dispatcher() on x64 sets thread stack to Rsp from the provided context and allocates stack layout for KiUserExceptionDispatcher relative to that one. However, the stack provided by the userspace upon calling NtRaiseException may reside below Rsp value provided in the context. And that is always the case when plain RaiseException() is called while BeingDebugged PEB flag is set (so that NtRaiseException is used). The problem is that the original context is overridden with memmove (also potentially when setting xstate), and frame->rbp gets wrong value breaking consequent unwind.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2832
This was either added by accident, or in an attempt to stop checking the message
list once we hit a winevent hook todo [and accidentally given too wide of a
scope]. However, the same commit also uses a global counter to ensure that only
one winevent todo is printed, so we don't need to break here anyway.
Fixes: a72bffe768c9fe462010d7e40e20226322fb82c7
--
v3: user32/tests: Do not stop checking the message list when skipping an optional or unsupported message.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2314