Repository navigation
d3d12_xs: the device and queue proxies follow the console method order, not the PC one, so a console method no longer lands on a wrong PC method (XValkyrie B4/B5) - #7490
Conversation
Device slots 43-82 and 104 are console methods (handled, accepted or refused, every call counted and reported with its caller); ID3D12Device1..8 are forwarded from 83-103 and 105-112. The queue proxy decides between the two known console layouts from the first fence call. Facts from xvalkyrie 53af7df77c10, checked against docs/d3d12_vulkan.md section 7. WIP: tests that use the proxy as a PC device still need moving.
…sts share device_method
…#6953 merges without a conflict
This reverts commit 23e7efb.
|
Measured in a local integration on main 9f53c50: the focused slot PRs compose into two working stacks - #6964 (26), #6954 (48), #7076 (73), #7066 (70), #7110 (25), #7052 (127), #7218+#6953 (133) - reaching 1,181 ok D3D12 calls in one stack and the descriptor heap / slot 70 / slot 133 / slot 25 sequence in another. This PR restructures all of those slots at once, so every one of them collides: Suggestion: split by slot, or rebase on the focused set and keep the slot table as the single shared change. Reviewing 7 small diffs is easier than re-verifying one large one, and a slot that regresses then has an obvious owner. |
|
An AI review of c69debd (Claude Code ultrareview, multi-agent with a verification pass; I checked the main claims against the head before posting). Four findings, most important first:
AI-assisted. |
|
Thanks @AwkGrep256 for the review, all four points confirmed and handled in |
|
Tested
AI-assisted: yes |
|
Thanks @sgonzalez-glitch, that run was exactly what was missing (my pod is Wine, no host D3D12). Pushed |
|
Tested The failure is Cause: this PR removes Shifting the indices (17-20 to 16-19, 25 to 24, 26-29 to 25-28, 30/31 to 29/30) makes No game files. AI-assisted (Claude Code). |
…andQueue1 case (a null fence entry no longer runs in-process and leaks a PC device reference)
|
@optinium51-bot thank you, that is the cause I could not find: removing |
Claimed in #6750 (comment)
@ItsNotRexed: an exe PR, as you asked.
What
The device and queue proxies follow the console vtable order instead of the PC one.
runtime/shims/d3d12_xs_console_slots.h(new): the console device order (0-42 public; console methods at 43-82 and 104;the public ID3D12Device1..5 at 83-103 and Device6..8 at 105-112, forwarded 39 or 40 slots lower) and the two known
queue layouts (kit2020 and the later kit, which moves everything from Signal on by 2).
60 CreateGraphicsPipelineStateX (console flag bits removed); 61 CreateSamplerX (84-byte console sampler); 68
GetGpuHardwareConfigurationX; 74/75 Register/UnregisterPagePoolX; 81 GetFrameStatisticsX (count 0, S_FALSE);
111 the feedback UAV with the console argument order; 49-54, 58, 69, 72 accepted with no effect. Anything else
is refused with E_NOTIMPL and never reaches a PC method.
moves a route away.
or a call at 32/33; the word is checked with VirtualQuery first. Until then a layout-dependent slot does nothing.
four argument words, so the first boot names every console method the exe uses.
Why
In PC order, console methods at 44-82 land on PC Device1..14 methods (#6498: slot 78 reached
CreateReservedResource2). The queue sent 16-18 to GetTimestampFrequency/GetClockCalibration/GetDesc, which the
console queue does not have there. This gets the exe past device and queue calls that went to the wrong method.
Tested
Pod p2 (RTX 4090), clang-cl + xwin, Wine, DISPLAY=:99.
at line 257 (a console slot reached a PC Device1+ method), and the two layout modes exit 5. Negative controls:
26 public Device1..8 slots must reach PC 44-72, and 44-82, 104 and 113-127 must reach none.
(d3d12_fence_timing check_luid: the test device's LUID is zero, line 248 on main).
d3d12_fence_timing, dxgi_device, d3d12_mesh, queue_proxy, device_proxy, xs_proxy_mock (d3d12_xs: route the public HLE's Xbox device slots 48/73/78/79/80 #6935's env tests now
expect the console order: a moved route leaves 78 refused; a public method at 86 reaches PC 47).
Shared helper: runtime/test/xs_console_call.h.
(queue_proxy's child-runner check hangs). With that one check skipped locally, queue_proxy's Vulkan run passes
on this branch (31 differential cases, all 128 queue and 64 fence slots covered); on main it stops at its guard
check. device_proxy skips on both (no host D3D12 under Wine).
xs_proxy_mock (6 modes) and xs_console_slots (3 modes).
What xvalkyrie gave
Facts only, from sammwyy/xvalkyrie (GPL-3.0) at commit 53af7df77c10: src/runtime/modules/d3d12x/device.cpp:4196-4262
(device order, names and argument shapes of 43, 44, 48, 49-55, 58, 60, 61, 68, 69, 72-75, 78-81 and the
Device1..8 positions), device.cpp:2036-2186 (the two queue layouts) and docs/research/d3d12x.md. The sampler
layout is the kit's as xvalkyrie read it. No code was copied. Checked against Leonida's own measurements
(docs/d3d12_vulkan.md §7, docs/d3d12_command_objects.md §3.5a): device slots 1, 14-16, 18, 19, 27, 38 in PC order
and 62/67/76 console-only all fit. Where they differ, ours is kept: xvalkyrie leaves 67 unknown, and its
CreateCommandQueueX has three arguments where docs/d3d12_xs_surface.md inferred a shader-queue parameter (recorded,
not used). docs/d3d12_command_objects.md §5.2a has the full table.
Overlaps
Open PRs touching the same dispatcher: #7201 (86/101/108 to PC Device2/5/8: the same mapping, a subset of this
one), #7115 (61), #7187 (caller logging), #7066 (70), #7235 (127), #7218/#7075/#7183 (133). Slots 70, 127 and 133
stay refused here for their owners. #7218 names 133 CreatePlacedResourceX; xvalkyrie puts that method at 44.
Known limits
GetDesc(queue slots 26/28) answersS_OKwithout writing the return buffer. Those slots are a different method in the other console layout, so writing through the first argument could corrupt memory; this PR leaves it open on purpose.CreatePlacedResourceX) is a committed stand-in, as its comment and the first-call log line say: the title's memory at that address is not shared with the resource.AI-assisted: yes