Move input polling to its own thread; fixed-width fast-changing UI numbers
Input thread: controller polling, pad publishing, and rumble forwarding were driven by the render loop, so a low/synced frame rate throttled how often guest input reached the game. New InputWorker owns the InputSource and runs poll + IPC publish + rumble on a dedicated ~1 kHz thread, independent of rendering. The UI thread reads a copy-safe InputSnapshot for the Controllers panel and relays the Steam-Input request/active/failed state to/from the worker (Steam init/shutdown now happen on the worker thread). IpcServer gained a mutex so the worker's publish() / hook_status() can't race the UI thread starting/stopping the shared-memory channel (use-after-unmap); InjectionPanel::test_input_ is now atomic. ControllersPanel::draw takes an InputSnapshot instead of the live InputSource. Fixed-width numbers: fast-changing readouts (menu-bar FPS/ms, Video pipeline rates + latency + graph legend, controller poll rates + round-trip sticks, audio buffered ms + frames/s) printed with %.0f etc., so they shifted/blurred as values crossed digit thresholds (99 -> 100) each frame. Padded them to fixed field widths so they stay put. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ add_executable(coop_host WIN32
|
||||
src/log_panel.cpp
|
||||
src/ui/app_chrome.cpp
|
||||
src/input/xinput_source.cpp
|
||||
src/input/input_worker.cpp
|
||||
src/inject/process_list.cpp
|
||||
src/inject/window_list.cpp
|
||||
src/inject/injector.cpp
|
||||
|
||||
Reference in New Issue
Block a user