[PR #158] runtime: handle Xbox device slot 81 (GetFrameEventsX) (resubmission of #8869) #211

Open
opened 2026-11-26 20:17:09 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/158
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: old-pr/9890


📝 Commits (1)

  • 128ed59 Merge remote-tracking branch 'origin/main' into d3d12-xs-slot55-81

📊 Changes

7 files changed (+158 additions, -17 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+1 -1)
📝 runtime/CMakeLists.txt (+3 -0)
📝 runtime/shims/d3d12_xs_device.cpp (+28 -4)
📝 runtime/shims/d3d12_xs_device.h (+10 -9)
➕ runtime/src/d3d12_xs_frame_events.h (+47 -0)
➕ runtime/test/d3d12_xs_frame_events_test.cpp (+44 -0)
📝 runtime/test/xs_proxy_mock_test.cpp (+25 -3)

📄 Description

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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/158 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/9890` --- ### 📝 Commits (1) - [`128ed59`](https://github.com/ubiquitarianism/leonida/commit/128ed59cdc3934fd2dadb2491c463eb8b06468d7) Merge remote-tracking branch 'origin/main' into d3d12-xs-slot55-81 ### 📊 Changes **7 files changed** (+158 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+1 -1) 📝 `runtime/CMakeLists.txt` (+3 -0) 📝 `runtime/shims/d3d12_xs_device.cpp` (+28 -4) 📝 `runtime/shims/d3d12_xs_device.h` (+10 -9) ➕ `runtime/src/d3d12_xs_frame_events.h` (+47 -0) ➕ `runtime/test/d3d12_xs_frame_events_test.cpp` (+44 -0) 📝 `runtime/test/xs_proxy_mock_test.cpp` (+25 -3) </details> ### 📄 Description > 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`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#211
No description provided.