diff options
| author | NotRexed <therealnothingfn@gmail.com> | 2026-11-25 17:39:29 -0500 |
|---|---|---|
| committer | NotRexed <therealnothingfn@gmail.com> | 2026-11-25 17:39:29 -0500 |
| commit | 79d905c4ce8e34f0ff59aa52ddb497a66780385b (patch) | |
| tree | c2497229fd069c339f48a832e46e4d2853b2dfea /docs/d3d12_command_objects.md | |
| parent | ed5d8570f19d521e5f8d3125ff99ac0c4ba1773c (diff) | |
runtime: console D3D12 slot tables from VIctory, with the Device11 switch
The device, queue, list and fence proxies now take each slot's meaning
from data, runtime/shims/d3d12_xs_slots.h, built from victory-gpu
(device.rs:402-458, queue.rs:957-1001, list.rs:2055-2173,
fence.rs:141-154) and Leonida's own measurements, each entry citing its
source; static_asserts refuse two entries for one slot. VIctory's switch
(device.rs:149-168) picks the layout: a device created as ID3D12Device11,
as the title's is, gets the console layouts; any other keeps the PC order
that Leonida's PC-interface tests (device_proxy_test, queue_proxy_test,
tiny_frame) drive. This replaces the guessed +4 list rule and the
PC-order queue and fence proxies for the title.
Console layout:
- Queue: Signal 16, Wait 17, GetTimestampFrequency 18 -> PC 14/15/16;
GetDesc 28 -> PC 18; ExecuteCommandLists 10 and ExecuteX 35 -> PC 10
(list proxies unwrapped); Signal2X 34 -> PC 14; PresentX 32 -> the
device's present handler (set_present_handler), else S_OK, as VIctory
answers; markers 11-13 ignored; 23/24 (SuspendX/ResumeX) and 31
(CopyPageMappingsBatchX) refused as open; every other slot refused.
- Fence slot 12: the address of a 64-bit word kept at the real fence's
completed value. CPU Signal and GetCompletedValue update it at once; a
console queue Signal registers SetEventOnCompletion on one process-wide
event whose thread-pool wait re-reads the listed fences.
- Device: 25/26/108 take the return buffer first (V resource.rs:802-811,
840-849, 2583-2593; Leonida retail_boot_chain 3.1; the title faults at
26 without it), either order accepted; 48 takes the console queue
description {type, flags, engine/pipe, queue} (queue.rs:464-495); 69 is
ignored; 74/75 keep page pools; 127 -> PC CreateCommittedResource3 with
a PC description and ALLOW_DISPLAY cleared (CreateCommittedResource in
COMMON before Device10); 57 is refused with its output nulled; 12 makes
console list proxies; every allocator is wrapped and its slot 9 is
accepted; a slot from 44 on that no source names is refused instead of
reaching the PC method at that number.
- List: queries 28-30 -> PC 52-54, the +4 block 32-55, 61 ExecuteIndirect,
80 DispatchX -> Dispatch, 85/86 -> CopyTextureRegion/CopyResource,
129 -> DispatchMesh, 139 ResetX -> Reset, 146 -> Barrier; 51 and 70
(float arguments) through thunks with the real prototype; the 59 marker
and VIctory's hints and syncs ignored; the console List5/List6 ids
answered (the list is made as ID3D12GraphicsCommandList).
Both layouts: device 78-81 are VIctory's frame clock (frame.rs), not the
HLE stand-in that returned at once.
Where the sources disagree (evidence from the title wins):
- List: the +4 rule sent 56-58 to the PC queries, 60 to EndEvent and 31
to ExecuteBundle. VIctory has the queries at 28-30 and names none of
27, 31, 56-58, 60, which are now refused. Leonida's 59 marker (FSR DLL)
fits VIctory's newer layout, where ExecuteIndirect moved to 61.
- Device 48: retail_boot_chain 3.2 read a PC description and had to
clamp Flags; VIctory's layout explains it (the pipe lands there).
- Device 75: PC CreateCommandQueue1 in Leonida, UnregisterPagePool in
VIctory: VIctory's in the console layout.
- Device 45/46/50: PC Device1/3 methods in Leonida; console methods
nobody names per VIctory's counts: refused in the console layout.
- Device 67: VIctory leaves it unimplemented with the same (desc, iid,
out) shape; Leonida's DeserializeComputePipelineStateX (FSR DLL) stays.
- Queue GetDesc: VIctory takes `this` first (queue.rs:950), the device's
struct returns take the buffer first; the queue accepts both.
- Frame clock: the stand-in made a token on every poll and refused a null
token; VIctory's (S_FALSE time-outs, a token only with flag 2) paces
the title.
Open: list 62, 71-74, 100 and 148 still return 0 (no Vulkan-layer path
for title addresses); queue 23/24/31 and device 61/70/71/86 refused;
XboxPresentation is not attached (gta6rt has no window, and its
FramePacer issues its own tokens and models only the origin event); a
title write to the fence word does not move the fence. Not run on the
title: it stops earlier, while DirectStorage is being ported.
Tested (MSVC 19.44, RelWithDebInfo, no Vulkan headers): xs_proxy_mock_test
checks every console queue (128) and list (160) slot against the tables
and through the proxies, the struct returns in both orders, 48, 69,
74/75, 127, 57, the refused device slots, the fence word with deferred
signals, PresentX and the frame clock (40 runs, no failure);
device_proxy_test runs the console layout on WARP. ctest: 116 of 117 pass
without loader; root_sig fails on the base commit too, and loader (no
D3D12 code) times out here. The Vulkan-only tests were not built.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs/d3d12_command_objects.md')
| -rw-r--r-- | docs/d3d12_command_objects.md | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/d3d12_command_objects.md b/docs/d3d12_command_objects.md index 5a214e325..e521cac72 100644 --- a/docs/d3d12_command_objects.md +++ b/docs/d3d12_command_objects.md | |||
| @@ -755,6 +755,13 @@ first calls; a wrong slot would therefore be visible as a misnamed call, not a s | |||
| 755 | 755 | ||
| 756 | Queues and fences are wrapped the same way. | 756 | Queues and fences are wrapped the same way. |
| 757 | 757 | ||
| 758 | A device created as `ID3D12Device11`, as the title creates its own, has the console layouts instead: its queues, | ||
| 759 | fences, allocators and lists follow the slot tables in `runtime/shims/d3d12_xs_slots.h`, taken from VIctory | ||
| 760 | (`victory/crates/victory-gpu/src/{device,queue,list,fence}.rs`, which runs the title) and from the measurements on | ||
| 761 | this page, each entry with its source. There the queue methods from slot 14 on are two later than the PC's, the | ||
| 762 | fence has a value address at slot 12, and device slot 12 makes console list proxies. What follows describes the PC | ||
| 763 | layout, which every other device keeps. | ||
| 764 | |||
| 758 | - **What is wrapped.** Device slots 8 (`CreateCommandQueue`), 75 (`CreateCommandQueue1`), 36 | 765 | - **What is wrapped.** Device slots 8 (`CreateCommandQueue`), 75 (`CreateCommandQueue1`), 36 |
| 759 | (`CreateFence`) and 32 (`OpenSharedHandle`, when it opens a fence) return queue and fence proxies. Each | 766 | (`CreateFence`) and 32 (`OpenSharedHandle`, when it opens a fence) return queue and fence proxies. Each |
| 760 | proxy forwards the public chain in PC order: 19 queue slots, and 11 or 12 fence slots, in SDK 10.0.26100. | 767 | proxy forwards the public chain in PC order: 19 queue slots, and 11 or 12 fence slots, in SDK 10.0.26100. |