D3D12.X: console command allocator #9, command list #75/#126/#131/#132/#142, and queue #31 extensions #225

Closed
Lum7nt wants to merge 1 commit from upstream-pr/228 into main
Lum7nt commented 2026-11-23 21:22:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Lum7nt on 2026-11-23T21:22:45Z.


Problem

As identified during retail game bring-up and Issue #159, several console Direct3D 12 extensions are frequently invoked by the game engine during startup:

  1. ID3D12CommandAllocator::#9: Registers the title's custom command memory allocator callback.
  2. ID3D12GraphicsCommandList::#75, #126, #131, #132, #142: Console command list extensions.
  3. ID3D12CommandQueue::#31: Queue extension on newer GDK layouts.

(Note: XGTextureAddressComputer::#10 was already implemented and merged upstream in commit 38b05b7.)

Changes

  • crates/xcl/src/hle/d3d12x/real.rs:
    • Added Kind::CommandAllocator => Some(9) to console_extensions and registered alloc_register_custom_allocator_x at slot 9.
    • Implemented alloc_register_custom_allocator_x to log the callback and return S_OK.
    • Registered slots 75, 126, 131, 132, and 142 in console_slots(Kind::CommandList).
    • Added detection and dispatch for newer layout queue extension #31 in queue_dispatch.
  • crates/xcl/src/hle/d3d12x/list_x.rs:
    • Implemented console stubs cmd_list_75_x, cmd_list_126_x, cmd_list_131_x, cmd_list_132_x, and cmd_list_142_x.
  • crates/xcl/src/hle/d3d12x/null.rs:
    • Added v[9] = Ret_S_OK as usize for Kind::CommandAllocator.
  • HANDOFF.md:
    • Documented the added console extensions.

Test Plan

  • cargo test -p xcl --lib hle::d3d12x: 56 passed; 0 failed
  • cargo test -p xcl --lib: 548 passed; 0 failed
<!-- greyfinch-sync:ivall/xcl:issue:6569103898 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/228). Originally posted by [Lum7nt](https://github.com/Lum7nt) on 2026-11-23T21:22:45Z. --- ## Problem As identified during retail game bring-up and [Issue #159](https://github.com/ivall/xcl/issues/159), several console Direct3D 12 extensions are frequently invoked by the game engine during startup: 1. `ID3D12CommandAllocator::#9`: Registers the title's custom command memory allocator callback. 2. `ID3D12GraphicsCommandList::#75`, `#126`, `#131`, `#132`, `#142`: Console command list extensions. 3. `ID3D12CommandQueue::#31`: Queue extension on newer GDK layouts. *(Note: `XGTextureAddressComputer::#10` was already implemented and merged upstream in commit `38b05b7`.)* ## Changes - **`crates/xcl/src/hle/d3d12x/real.rs`**: - Added `Kind::CommandAllocator => Some(9)` to `console_extensions` and registered `alloc_register_custom_allocator_x` at slot 9. - Implemented `alloc_register_custom_allocator_x` to log the callback and return `S_OK`. - Registered slots 75, 126, 131, 132, and 142 in `console_slots(Kind::CommandList)`. - Added detection and dispatch for newer layout queue extension `#31` in `queue_dispatch`. - **`crates/xcl/src/hle/d3d12x/list_x.rs`**: - Implemented console stubs `cmd_list_75_x`, `cmd_list_126_x`, `cmd_list_131_x`, `cmd_list_132_x`, and `cmd_list_142_x`. - **`crates/xcl/src/hle/d3d12x/null.rs`**: - Added `v[9] = Ret_S_OK as usize` for `Kind::CommandAllocator`. - **`HANDOFF.md`**: - Documented the added console extensions. ## Test Plan - [x] `cargo test -p xcl --lib hle::d3d12x`: 56 passed; 0 failed - [x] `cargo test -p xcl --lib`: 548 passed; 0 failed
upstream-sync closed this pull request 2026-11-24 06:57:45 +00:00
ivall commented 2026-11-24 07:04:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T21:29:56Z.


Not merged: these turn the generic stubs into named no-ops (and allocator #9 into S_OK as RegisterCustomAllocator), but nothing here shows what the slots do - a name and a no-op are guesses that hide the call from called_stubs, where it is visible now. A PR for one slot with evidence of its arguments and effect (a trace of the title's calls, the console library's code) would be welcome. It is also 78 commits behind main.

<!-- greyfinch-sync:ivall/xcl:comment:7114540699 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/228#issuecomment-7114540699). Originally posted by [ivall](https://github.com/ivall) on 2026-11-23T21:29:56Z. --- Not merged: these turn the generic stubs into named no-ops (and allocator #9 into S_OK as `RegisterCustomAllocator`), but nothing here shows what the slots do - a name and a no-op are guesses that hide the call from `called_stubs`, where it is visible now. A PR for one slot with evidence of its arguments and effect (a trace of the title's calls, the console library's code) would be welcome. It is also 78 commits behind main.

Pull request closed

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!225
No description provided.