HLE: SDL3 gamepad backend for the gameinput shim #312
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/312"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T02:14:35Z.
Part of #187: this is the SDL3 gamepad backend and the trigger rumble. Sensors/gyro and glyph profiles are follow-ups.
What
host::sdlloadsSDL3.dllat run time and reads up to four pads through SDL's gamepad API: buttons (positional A/B/X/Y), sticks (Y flipped to XInput's up-positive convention), both triggers, and hotplug (the list is rescanned every second).SDL_RumbleGamepadandSDL_RumbleGamepadTriggers; the shim now passes all four motor levels to the backend instead of dropping the trigger pair. XInput keeps the two body motors.SDL_Init(SDL_INIT_GAMEPAD)succeeds.VICTORY_INPUT=xinput|sdl3forces a backend.Tested
SDL3.dllnext to the exe) and a GameSir G7 Pro: pad found, and A/B, bumpers, dpad, both sticks and both triggers were read live (values moved as expected; Y axis correctly inverted).cargo test -p victory-hleunder the same setup: 85 passed, 1 failed. The failure ismodules::net::tests::only_loopback_is_reachable(Wine lacksWSAConnectByList; #195/#217 territory), not this change.SDL3.dll,host::source()selects XInput and the suite is unchanged.Not in this PR
SDL_OpenSensor/SDL_GetSensorData).SDL_GetGamepadTypedetection and the glyph-profile work.No game data used.
Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T03:48:15Z.
Status against current
main(d2a4bae): CLEAN / MERGEABLE, no reviews and no checks. Re-ran the Windows build under Wine 11.22:victory-hle85 passed, 1 failed — onlymodules::net::tests::only_loopback_is_reachable(WineWSAConnectByList, #217).Coordination: the rumble plumbing here overlaps #26 (both change
Source::rumbleto carry the four motor levels). #26 predates this PR and is smaller (+71/−16), while this one also adds the SDL3 backend;git merge-tree --write-tree pr312 pr26reportsCONFLICT (content)ingameinput.rs. If #26 lands first, this branch needs a rebase — or this PR can keep only the SDL3 backend and leave the sharedMotorschange to #26.No game data used.
Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T04:19:29Z.
Tested PR #312 at head
191e335d784888d37d7c0626a95c377e38ba87e5(state at test time: OPEN). Pre-comment refresh: state OPEN, head unchanged at191e335d784888d37d7c0626a95c377e38ba87e5.cargo test --locked -p victory-hle --lib— passed (ok. 86 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.56s ); cases: modules::audio::tests::full_message_queues_count_drops, modules::display::tests::sdr_and_display_deferrals, modules::dsp::tests::convolution_stream_as_the_title_drives_it, modules::dstorage::tests::request_layout_is_the_titles, and 82 more.Behavior covered: Runs the HLE library unit suite with the new SDL3 gamepad backend compiled; there is no dedicated gameinput test added by this PR.
Code: crates/victory-hle/src/modules/gameinput.rs
Imported from Marvisak/VIctory. Originally posted by pluvialmoon on 2026-11-24T14:30:39Z.
Ran into this with a Stadia Controller (HID, not XInput) on Windows 11 / RTX 5060: Source::rumble is called on the title's thread while Source::pad is on the hub's poll thread. If the backend initialises SDL from rumble too, the first rumble after a poll re-initialises SDL on the title's thread — seen as eight "SDL gamepad" log lines in a row on a world load. Worth guarding in host::sdl: only the poll thread should own SDL.
Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T18:01:45Z.
Status/coordination: the rumble signature is now contested by several PRs.
Rumblestruct (WinRTWindows.Gaming.Input+ XInput fallback + async worker + zeroing on disconnect/focus), and looks like the more complete Windows path.[f32; 4]and adds the SDL3 backend.They conflict in
gameinput.rs(merge-treebetween this head and #1357 reports a conflict). Suggestion: let the winningRumblesignature land first, then rebase this branch onto it and keep only the SDL3 source (SDL_RumbleGamepad/SDL_RumbleGamepadTriggers), dropping the duplicated XInput signatures. No code change made yet; happy to adjust once the maintainers pick one.Imported from Marvisak/VIctory. Originally posted by pfhandler on 2026-11-24T20:51:44Z.
Local patches for two issues hit while running GTA VI 1.0.2.1 through VIctory on Linux (GE-Proton 11-14, vkd3d-proton 3.2.0, RTX 4060 Ti 8 GB):
VICTORY_NO_HOST_PAD=1— a connected host pad (e.g. DualShock appearing as XInput pad 0) keeps the keyboard stand-in pad from being enumerated. Hiding the host pad letsVICTORY_KEYSdrive the title again.VICTORY_MODE=1920x1080— the DXGI output mode list is fixed at the console's 3840x2160. Reporting 1920x1080 instead keeps the title's render targets and VRAM use down on smaller hosts (Series S profile + 1080p settled around 3.5 GB VRAM here).Both are local uncommitted diffs, posted here for reuse. Tested only on the configuration above.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:30:03Z.
Automated triage for the maintainers.
Needs rebase. This pull request conflicts with
main(conflicting:crates/victory-hle/src/modules/gameinput.rs). It will be reviewed once it is rebased onto the currentmain.Generated by Claude Code
upstream-sync referenced this pull request2026-11-25 07:03:16 +00:00
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.