Repository navigation
Conversation
The d3d12_xs shim's device now hands callers console-shaped command lists (160-slot vtable, object body at +0x18 with the write cursor pinned at the record limits, console slots 27-30 recorded not forwarded, slot map measured to the PC table: 60->58, 61->59, 146->80). Queue layout detection is atomic and device-wide; SignalX (slot 23/25 by layout) forwards as Signal, PresentX (30/32) reaches the presentation core, and ambiguous slot 18 serves the timestamp- frequency getter until the layout is proven. AllocateUploadMemory (console slot 148) carves a bump arena out of persistently-mapped UPLOAD-heap buffers; the six root-VA setters and the IA/SO view setters translate arena pointers to buffer device addresses in proxy-owned copies. Impossible sizes and non-power-of- two alignments are refused before any arithmetic that could wrap. PC-compiled callers opt into real PC-shaped lists with console_lists=false on create_device_proxy, and PC-compiled guests with LEONIDA_D3D12_LISTS=pc — the fixture path check_tiny_frame.py sets, so a guest ClearRenderTargetView at PC slot 48 reaches the real list. The GPU tests take the flag; unmeasured console slots stay console-shaped for the title path. docs/d3d12_xs_console_abi.md records the measured ABI. Split from ItsNotRexed#2490 (third of three): fixes the run_tiny_frame failure the revert reported. AI-assisted. Hardware verification on the earlier identical code is in ItsNotRexed#2490's thread (RTX 3060 Ti-5080, RX 7600/9060/9070/7900 XT, Intel UHD, RADV; 177/177). Wine/clang-cl on the build host: xs_proxy_mock PASS incl. the overflow regression, queue_proxy child-runner section fails identically on unmodified main (Wine env), loader_test 86/0 upstream count. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
test_every_variable_is_named_in_a_document fails when a code-used environment variable is documented nowhere. The variable is described in the command-list section where the two list layouts are defined. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Upstream's device routes Xbox slot 73, but returned the real PC list unwrapped: the title's next console-slot call read through the PC vtable. With console_lists the device now builds the real list as ID3D12GraphicsCommandList and wraps it like the slot-12 path; a console IID is answered by the list proxy's QueryInterface.
The title's first call on a wrapped list is QueryInterface with the console command-list IID c3827890-...-51dc4874; is_list_iid knew only PC IIDs and refused it. Port the measured console->PC IID table from (closed, unmerged) ItsNotRexed#7124 into d3d12_xs_command_list_iid.h and run the requested IID through it in list_query_interface and in the PC-mode slot-73 path, so a console IID maps to ID3D12GraphicsCommandList6 and the caller gets the console-shaped proxy back.
create_device_proxy's console_lists default was true, so every test harness that links the TU and calls it directly got console-shaped lists and crashed or failed Close on PC vtable indices (kormocicsaba: d3d12_bindless_churn segfault, d3d12_mesh Close). The console shape is the title path: D3D12XboxCreateDevice opts in (unless LEONIDA_D3D12_LISTS=pc), and the default is now false so direct callers keep the pre-PR behaviour. The mock test pins both: slot 12 on a console_lists=false device returns the real list.
Pipodi measured the retail title calling console list slot 139 with (allocator proxy, pso) before recording — Reset, at PC slot 10. Map it and unwrap the allocator (and a pipeline state the same way); the unwrap now keys on the PC slot so console-10 and console-139 both land on the real Reset. xs_proxy_mock: PASS under Wine Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The console build imports GameInput.dll by ordinal, not by name; the import binds 'ItsNotRexed#1' and the name-only table misses it, so a boot fell through to the host GameInput.dll or the unimplemented thunk instead of the shim (registry.cpp already classifies 'ItsNotRexed#1' as an HResult name for this DLL).
…typed thunk Console list slot 70 is ID3D12GraphicsCommandList1::OMSetDepthBounds(FLOAT Min, FLOAT Max): a static read of the retail caller shows it passing only `this` and two floats (XMM1 = Min, XMM2 = Max), right after every OMSetRenderTargets. The console-to-PC map had no entry for 70, so ListProxy recorded the call and returned 0 without reaching the real list. Map 70 to PC slot 62 and install a typed WINAPI thunk for it, the way ItsNotRexed#7880 does for ClearDepthStencilView: the all-uint64_t list_slot thunk reads RDX/R8 and never forwards XMM registers, so it cannot carry the floats. A real list without ID3D12GraphicsCommandList1 (60 slots) drops the call with a one-time warning; the method is void, so there is no HRESULT to return. xs_proxy_mock_test gets check_depth_bounds: the list mocks take PC slot 62 typed, and the test checks Min/Max on the first and later calls, no neighbouring slot hit, and the drop on a GCL-only list. docs/d3d12_xs_console_abi.md: slot 70 in the method table, and a table of measured but unnamed list slots (71, 72, 74, 75, 126, 131, 132, 142, 146) with their argument shapes and call counts only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Verified on native Windows 11 (
AI-assisted. |
|
Tested
AI-assisted (Gemini). |
This was referenced Nov 23, 2026
Closed
|
Tested
AI-assisted: yes |
1 of 2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: #8683 (comment)
Depends on: #2490.
ListProxyonly exists there, so this branch is based on its current head (084c8bd09). This PR's own diff is the one commit on top,471dd0b8f("d3d12_xs: forward console list slot 70 to PC OMSetDepthBounds with a typed thunk"). Until #2490 lands, GitHub shows #2490's commits here too.What and why
Slot 70 was silently swallowed. #2490's console-to-PC list map has no entry for console slot 70.
ListProxyrecords the call and returns 0, and the real list never sees it. From a static read of the retail executable, slot 70 isID3D12GraphicsCommandList1::OMSetDepthBounds(FLOAT Min, FLOAT Max):thisand two floats (XMM1 = Min, XMM2 = Max);OMSetRenderTargets.A typed thunk is needed. On the Windows x64 ABI the two floats travel in XMM1/XMM2. The generic all-
uint64_tlist_slot<Slot>thunk reads RDX/R8 and never forwards the XMM registers, so mapping the slot alone is not enough. This is the same problem #7880 solves forClearDepthStencilView, and this PR follows #7880's approach:console_to_pc_list_slot(70)returns PC slot 62 (ID3D12GraphicsCommandList1).WINAPIthunk,list_om_set_depth_bounds(ListProxy*, FLOAT, FLOAT), is installed over slot 70 infill_list_vtable, after the fold, the same way d3d12_xs: translate title-owned CPU descriptor handles in ListProxy and preserve ClearDepthStencilView FLOAT Depth #7880 installs its slot-51 thunk. It records the call (the first-call log shows the float bits) and forwards both floats to the real list's PC slot 62.ID3D12GraphicsCommandList1(60 slots), the call is dropped with a one-time warning. The method isvoid, so there is noE_NOTIMPLto return.The two PRs both add a line to
fill_list_vtableand a typed slot to the list mocks. Whichever lands second has a one-line merge there; the changes do not overlap in meaning.Docs (
docs/d3d12_xs_console_abi.md§5.3):None of these slots is forwarded by this PR except 70. 146 was already routed to
Barrierby #2490.Tested
Linux, Wine 11.21 (a separate, freshly created test prefix), clang-cl/lld-link cross build against the MSVC CRT and Windows SDK from xwin. No GPU and no game data needed.
xs_proxy_mock_testgets a newcheck_depth_bounds. The list mocks now take PC slot 62 typed (mock_om_set_depth_bounds(Mock*, FLOAT, FLOAT)), so the test sees the floats as the real list would. It checks:(0.125, 0.875), the default(0, 1)and an inverted(0.75, 0.25);list_slot_hits(70)counts every call;ID3D12GraphicsCommandList(60 slots), the call is recorded and dropped, and nothing reaches the mock;xs_proxy_mock_testunder Winexs_proxy_mock line 1012: real->calls[62] == 1 && real->depth_bounds_min == 0.125f && real->depth_bounds_max == 0.875f. The first-call log shows slot 70 receiving0x0 0x0in place of the floats.xs_proxy_mock: console list slot 70 reaches PC OMSetDepthBounds with Min/Max intact; a list without ID3D12GraphicsCommandList1 drops it…xs_proxy_mock_test: PASS (9 allocations refused on purpose)ctest -R 'xs_proxy_mock|fsr_dispatch': all sixxs_proxy_mock*tests pass (plain,--fail-virtualalloc,--fail-virtualprotect,--fail-veh,--env-slots,--env-slots-invalid).fsr_dispatchreports itself as skipped here.d3d12_xs_device.cpp.Not verified
AI-assisted (Claude Code).
🤖 Generated with Claude Code