runtime: handle Xbox device slot 81 (GetFrameEventsX) (resubmission of #8869) #158

Open
github-bot wants to merge 3 commits from github-bot/gh-158 into main AGit
Owner

@⁠Andretuta on GitHub · 2026-11-24 02:31 UTC · original
ubiquitarianism:old-pr/9890 → main · +158 −17 · 7 files · 1 commits · draft

Carried over from old PR 9890 by SweatierKey in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9890, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
This branch conflicts with the current main and needs a rebase.
SweatierKey: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Clean resubmission of #8869 (closed during the bulk PR sweep at 22:39Z, 6 minutes after resolving the merge conflict with main in commit 128ed59cd). Zero overlapping open PRs for slot 81.

Summary

  • Implements Xbox Series ID3D12DeviceX slot 81 (GetFrameEventsX / GetFrameStatisticsX) in runtime/src/d3d12_xs_frame_events.h and wires it in runtime/shims/d3d12_xs_device.{h,cpp} with LEONIDA_XS_FRAME_EVENTS_SLOT env-var remap support (documented in docs/d3d12_vulkan.md).
  • Validates parameters (E_POINTER on null in_out_count, E_INVALIDARG on invalid flags or non-zero count with null buffer), writes 0 events, and returns S_OK, matching the 0x38-byte record geometry.
  • Adds portable unit tests in runtime/test/d3d12_xs_frame_events_test.cpp and proxy/remap tests in runtime/test/xs_proxy_mock_test.cpp (using slot 102 for remap test compatibility).

Prior independent verifications & approval on #8869

  • Approved by @svds12343 (native Windows 11/MSVC, 9/9 focused runtime + 7/7 doc tests PASS).
  • Independently verified PASS by @MarcPique (7/7 + retail RTX 4090), @simonbronk (retail RTX 5070), @seblessa (retail RTX 4080 SUPER), and @dadnotdaddy (9/9).
  • Static 1.0.2.1 call-site ABI (flags = 0x11100, count = 6, 0x38-byte records) independently confirmed by @LooperSalty (#8869#issuecomment-7115222733).

Verification on current origin/main (f2c3a96a4)

  • Clean merge onto origin/main@f2c3a96a4 (git merge-tree --write-tree clean).
  • Linux x86-64 (GCC 14.2.0): g++ -std=c++20 -O2 -Wall -Wextra -Wconversion -Werror -fsanitize=address,undefined runtime/test/d3d12_xs_frame_events_test.cpp PASS (0 warnings, 0 findings); ctest -R '^d3d12_xs_frame_events$' 1/1 PASS; scripts/check_no_game_data.py exit 0; tests/test_docs_env_vars.py 4/4 OK.
  • Windows xs_proxy_mock_test build: not re-run on this Linux host after the 2-line conflict resolution with case 133 / slot == 133 in 128ed59cd.
**@⁠Andretuta** on GitHub · 2026-11-24 02:31 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/158) `ubiquitarianism:old-pr/9890` → `main` · +158 −17 · 7 files · 1 commits · draft > Carried over from **old PR 9890** by `SweatierKey` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9890`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > This branch conflicts with the current `main` and needs a rebase. > `SweatierKey`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Clean resubmission of `#8869` (closed during the bulk PR sweep at `22:39Z`, 6 minutes after resolving the merge conflict with `main` in commit `128ed59cd`). Zero overlapping open PRs for slot 81. ### Summary - Implements Xbox Series `ID3D12DeviceX` slot 81 (`GetFrameEventsX` / `GetFrameStatisticsX`) in `runtime/src/d3d12_xs_frame_events.h` and wires it in `runtime/shims/d3d12_xs_device.{h,cpp}` with `LEONIDA_XS_FRAME_EVENTS_SLOT` env-var remap support (documented in `docs/d3d12_vulkan.md`). - Validates parameters (`E_POINTER` on null `in_out_count`, `E_INVALIDARG` on invalid flags or non-zero count with null buffer), writes `0` events, and returns `S_OK`, matching the `0x38`-byte record geometry. - Adds portable unit tests in `runtime/test/d3d12_xs_frame_events_test.cpp` and proxy/remap tests in `runtime/test/xs_proxy_mock_test.cpp` (using slot `102` for remap test compatibility). ### Prior independent verifications & approval on `#8869` - **Approved** by `@svds12343` (native Windows 11/MSVC, 9/9 focused runtime + 7/7 doc tests PASS). - Independently verified PASS by `@MarcPique` (7/7 + retail RTX 4090), `@simonbronk` (retail RTX 5070), `@seblessa` (retail RTX 4080 SUPER), and `@dadnotdaddy` (9/9). - Static 1.0.2.1 call-site ABI (`flags = 0x11100`, `count = 6`, `0x38`-byte records) independently confirmed by `@LooperSalty` (`#8869`#issuecomment-7115222733). ### Verification on current `origin/main` (`f2c3a96a4`) - Clean merge onto `origin/main@f2c3a96a4` (`git merge-tree --write-tree` clean). - Linux x86-64 (GCC 14.2.0): `g++ -std=c++20 -O2 -Wall -Wextra -Wconversion -Werror -fsanitize=address,undefined runtime/test/d3d12_xs_frame_events_test.cpp` PASS (0 warnings, 0 findings); `ctest -R '^d3d12_xs_frame_events$'` 1/1 PASS; `scripts/check_no_game_data.py` exit 0; `tests/test_docs_env_vars.py` 4/4 OK. - Windows `xs_proxy_mock_test` build: not re-run on this Linux host after the 2-line conflict resolution with `case 133` / `slot == 133` in `128ed59cd`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:46:50 +00:00
This pull request has changes conflicting with the target branch.
  • docs/d3d12_vulkan.md
  • runtime/shims/d3d12_xs_device.cpp
  • runtime/shims/d3d12_xs_device.h
  • runtime/test/xs_proxy_mock_test.cpp
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/158/head:github-bot/gh-158'
git switch 'github-bot/gh-158'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-158'
git switch 'github-bot/gh-158'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-158'
git switch 'github-bot/gh-158'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-158'
git switch 'main'
git merge --squash 'github-bot/gh-158'
git switch 'main'
git merge --ff-only 'github-bot/gh-158'
git switch 'main'
git merge 'github-bot/gh-158'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.