D3D12.X: strip Xbox root signature flags for PC and honor FORCE_MEMORY_BASED_ABI #3244

Merged
Kalmarv merged 1 commit from upstream-pr/3244 into main 2026-11-29 00:08:22 +00:00
Kalmarv commented 2026-11-28 23:56:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-28T23:56:00Z.


Strip Xbox-only root-signature flags (0x0300_0000) when passing console RTS0 blobs to PC ID3D12Device::CreateRootSignature and handle FORCE_MEMORY_BASED_ABI (0x0100_0000) in console_list::layout_from_blob.

Console root signatures can carry two Xbox-only RTS0 flags above PC D3D12's flag bits: FORCE_MEMORY_BASED_ABI (0x0100_0000, which forces all root parameters out of inline SGPRs into memory) and ALLOW_NON_UNIFORM_RESOURCES (0x0200_0000). Passing those bits verbatim causes PC CreateRootSignature to fail and fall back to an empty root signature, breaking any CreateCommandSignature or draw/dispatch that references root parameters; meanwhile layout_from_blob still packed inline SGPRs when FORCE_MEMORY_BASED_ABI was set.

What is in it

  • crates/xcl/src/hle/d3d12x/console_list.rs: add FORCE_MEMORY_BASED_ABI (0x0100_0000) / XBOX_ROOT_SIGNATURE_FLAGS (0x0300_0000) and pc_root_signature_blob (which clears 0x0300_0000 in the RTS0 chunk and recomputes the DXBC retail MD5 container hash); spill all root parameters into memory in layout_from_blob when FORCE_MEMORY_BASED_ABI is set; add unit test force_memory_based_abi_spills_all_parameters_and_strips_xbox_flags.
  • crates/xcl/src/hle/d3d12x/real.rs: pass pc_root_signature_blob to PC CreateRootSignature in dev_create_root_signature while keeping the original console blob for console_list::note_root_signature; add WARP test root_signature_tests::dev_create_root_signature_strips_xbox_flags_and_keeps_parameters verifying raw PC CreateRootSignature rejects 0x0300_0000, the hooked call succeeds with root parameter 0 intact for CreateCommandSignature, and layout_of records all parameters spilled.

Tested

  • Hardware / toolchain: NVIDIA GeForce RTX 5070 Ti (driver 32.0.16.1074), AMD Ryzen 9 9950X, Windows 11 Pro (build 26200), rustc 1.99.0 (b940084d7 2026-09-28), DXC 1.9 (XCL_DXC_DIR), debug for tests and release for xcl-smoke.
  • Targeted tests (cargo test -p xcl --lib -- force_memory_based_abi_spills_all_parameters_and_strips_xbox_flags dev_create_root_signature_strips_xbox_flags_and_keeps_parameters --nocapture): 2 passed, 0 failed, 0 skipped (both fail before the fix).
  • Full workspace (cargo test --workspace -- --test-threads=4 --skip test_title_runs_and_game_folder_is_untouched --skip uma_driver::tests::): 2588 passed, 0 failed, 49 ignored.
  • SKIPPED GPU tests on this adapter (26 total): 21 no wave64 (RTX 5070 Ti is wave32), 3 wave32 per-lane #1426 f16/cvt-f16 refusals, 2 no heap windows (opt-in XCL_HEAP_WINDOWS=1).
  • Retail title (ea3b5e4d) 150 s regression run below (0 device removals, 0 crashes, 1901 frames vs 1695 on main, 32269 MB peak commit vs 31546 MB on main).

Regression run

xcl-smoke v1
commit: f0e8fdd5c3942ddd399d5ee11384c8595c5aacff
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 150
exit: 0x0
frames shown: 1695 (PresentX 1695)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 31546 MB
xcl-smoke v1
commit: 6d0c83bcc81d1e9c82d13552ed7add38107ba81e
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 150
exit: 0x0
frames shown: 1901 (PresentX 1901)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 32269 MB

Not tested

  • AMD RDNA / wave64 GPUs and real titles that ship root signatures with 0x0100_0000 / 0x0200_0000 set (the ea3b5e4d smoke is a regression check only; root-signature flag stripping and FORCE_MEMORY_BASED_ABI spilling are covered by the unit and WARP device tests).
  • uma_driver::tests:: (skipped locally due to pre-existing 0x7C10003 exit on NVIDIA) and test_title_runs_and_game_folder_is_untouched.

AI use

  • Antigravity (Gemini) used for root-cause verification, implementation, test authoring, and local verification; all diffs, tests, and smoke outputs reviewed and run locally.
<!-- greyfinch-sync:ivall/xcl:issue:5545812420 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3244). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-28T23:56:00Z. --- Strip Xbox-only root-signature flags (`0x0300_0000`) when passing console `RTS0` blobs to PC `ID3D12Device::CreateRootSignature` and handle `FORCE_MEMORY_BASED_ABI` (`0x0100_0000`) in `console_list::layout_from_blob`. Console root signatures can carry two Xbox-only `RTS0` flags above PC D3D12's flag bits: `FORCE_MEMORY_BASED_ABI` (`0x0100_0000`, which forces all root parameters out of inline SGPRs into memory) and `ALLOW_NON_UNIFORM_RESOURCES` (`0x0200_0000`). Passing those bits verbatim causes PC `CreateRootSignature` to fail and fall back to an empty root signature, breaking any `CreateCommandSignature` or draw/dispatch that references root parameters; meanwhile `layout_from_blob` still packed inline SGPRs when `FORCE_MEMORY_BASED_ABI` was set. **What is in it** - `crates/xcl/src/hle/d3d12x/console_list.rs`: add `FORCE_MEMORY_BASED_ABI` (`0x0100_0000`) / `XBOX_ROOT_SIGNATURE_FLAGS` (`0x0300_0000`) and `pc_root_signature_blob` (which clears `0x0300_0000` in the `RTS0` chunk and recomputes the DXBC retail MD5 container hash); spill all root parameters into memory in `layout_from_blob` when `FORCE_MEMORY_BASED_ABI` is set; add unit test `force_memory_based_abi_spills_all_parameters_and_strips_xbox_flags`. - `crates/xcl/src/hle/d3d12x/real.rs`: pass `pc_root_signature_blob` to PC `CreateRootSignature` in `dev_create_root_signature` while keeping the original console blob for `console_list::note_root_signature`; add WARP test `root_signature_tests::dev_create_root_signature_strips_xbox_flags_and_keeps_parameters` verifying raw PC `CreateRootSignature` rejects `0x0300_0000`, the hooked call succeeds with root parameter 0 intact for `CreateCommandSignature`, and `layout_of` records all parameters spilled. **Tested** - Hardware / toolchain: NVIDIA GeForce RTX 5070 Ti (driver 32.0.16.1074), AMD Ryzen 9 9950X, Windows 11 Pro (build 26200), `rustc 1.99.0 (b940084d7 2026-09-28)`, DXC 1.9 (`XCL_DXC_DIR`), debug for tests and release for `xcl-smoke`. - Targeted tests (`cargo test -p xcl --lib -- force_memory_based_abi_spills_all_parameters_and_strips_xbox_flags dev_create_root_signature_strips_xbox_flags_and_keeps_parameters --nocapture`): 2 passed, 0 failed, 0 skipped (both fail before the fix). - Full workspace (`cargo test --workspace -- --test-threads=4 --skip test_title_runs_and_game_folder_is_untouched --skip uma_driver::tests::`): 2588 passed, 0 failed, 49 ignored. - `SKIPPED` GPU tests on this adapter (26 total): 21 `no wave64` (RTX 5070 Ti is wave32), 3 wave32 per-lane `#1426` f16/cvt-f16 refusals, 2 `no heap windows` (opt-in `XCL_HEAP_WINDOWS=1`). - Retail title (`ea3b5e4d`) 150 s regression run below (`0` device removals, `0` crashes, `1901` frames vs `1695` on `main`, `32269 MB` peak commit vs `31546 MB` on `main`). **Regression run** ``` xcl-smoke v1 commit: f0e8fdd5c3942ddd399d5ee11384c8595c5aacff gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 150 exit: 0x0 frames shown: 1695 (PresentX 1695) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 31546 MB ``` ``` xcl-smoke v1 commit: 6d0c83bcc81d1e9c82d13552ed7add38107ba81e gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 150 exit: 0x0 frames shown: 1901 (PresentX 1901) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 32269 MB ``` **Not tested** - AMD RDNA / wave64 GPUs and real titles that ship root signatures with `0x0100_0000` / `0x0200_0000` set (the `ea3b5e4d` smoke is a regression check only; root-signature flag stripping and `FORCE_MEMORY_BASED_ABI` spilling are covered by the unit and WARP device tests). - `uma_driver::tests::` (skipped locally due to pre-existing `0x7C10003` exit on NVIDIA) and `test_title_runs_and_game_folder_is_untouched`. **AI use** - Antigravity (Gemini) used for root-cause verification, implementation, test authoring, and local verification; all diffs, tests, and smoke outputs reviewed and run locally.
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
xcl-dev/xcl!3244
No description provided.