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

Closed
github-bot wants to merge 1 commit from gh-pr/228/head into gh-pr/228/base
Owner

@⁠Lum7nt on GitHub · 2026-11-23 21:22 UTC · original
Lum7nt:fix/d3d12x-console-extensions → main · +67 −1 · 4 files · 1 commits · closed without merging

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
**@⁠Lum7nt** on GitHub · 2026-11-23 21:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/228) `Lum7nt:fix/d3d12x-console-extensions` → `main` · +67 −1 · 4 files · 1 commits · closed without merging ## 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
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:16:43 +00:00
github-bot closed this pull request 2026-11-26 04:16:43 +00:00
Author
Owner

@⁠ivall on GitHub · 2026-11-23 21:29 UTC · original

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.

**@⁠ivall** on GitHub · 2026-11-23 21:29 UTC · [original](https://github.com/xcl-dev/xcl/pull/228#issuecomment-7114540699) 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

This discussion has been locked. Commenting is limited to contributors.
No description provided.