Repository navigation
Conversation
The retail executable calls GetCustomHeapProperties (device slot 26) with the C convention: the hidden return buffer in RCX and the device in RDX. The proxy's generic forwarder assumed the PC C++ form (this in RCX, buffer in RDX), took the buffer for the device and crashed on its vtable right after D3D12XboxCreateDevice. Slots 25 (GetResourceAllocationInfo, same rule, inferred) and 26 (measured) now get thunks that accept either form: whichever of the first two arguments is the device proxy is `this`. The runtime's own code still calls the proxy through d3d12.h in the PC form. device_proxy_test calls both slots in both forms against WARP. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested on the retail executable: pass for slot 26. Own 1.0.2.1 copy (exe sha256
Slot 25 isn't reached before that stop, so the slot 25 half isn't exercised by the retail boot yet. #6964 gives the same result for slot 26 on the same base. AI-assisted (Claude Code). |
devnull34
left a comment
There was a problem hiding this comment.
Hardware & Environment
- Host: Windows 11 Build 26300 x64
- GPU: AMD Radeon RX 7900 GRE (16 GB VRAM)
- Toolchain: MSVC 19.44 (Visual Studio 2022), CMake 4.4
Verification Summary
Targets compiled with MSVC 19.44 and executed natively:
-
device_proxy_test.exe:- Passed with 0 failures.
- Verified that device slots 25 (
GetResourceAllocationInfo) and 26 (GetCustomHeapProperties) dynamically handle both MSVC C-ABI (hidden return buffer in RCX, device in RDX, as called by retail console binaries) and PC C++-ABI conventions (device in RCX, buffer in RDX). - Verified that both slots return the caller's buffer in RAX and preserve expected property outputs without crashing or vtable misinterpretation.
-
CTest:
device_proxy: Passed (0.06s)device_proxy_trace: Passed (0.05s)- Total: 2/2 passed (100%).
-
Hygiene & Compliance:
- Clean-room compliant: pure synthetic unit tests; zero game assets or proprietary code.
git diff HEAD~1..HEAD --check: Clean (0 whitespace/formatting defects).
LGTM!
|
Tested
I'll rerun once it's rebased. |
|
Tested Retail Xbox Series 1.0.2.1 package + executable (sizes match
Outcomes only; no game data. |
|
Closing in favour of #6964 (@sennecools), which makes the same slot 26 change, was opened first and claimed earlier (D3D-669). Thanks to everyone who tested this one; the results carry over, since the measured call shape is the same. The one thing this PR had beyond slot 26 is slot 25 ( |
…t 26 from ItsNotRexed#6964, slot 25 return-buffer form kept from ItsNotRexed#6973
…(RT-5 stop 17) The retail title asserts when its first full-screen render targets leave more than 2 MiB of a fixed budget unused (docs/retail_boot_chain.md, ItsNotRexed#6982). The PC size is about width x height x element bytes; the console takes whole RDNA2 SW_64KB tiles. Slot 25 adds the difference per render target description and never lowers a size. Depends on ItsNotRexed#6973.
Claimed in the coordination issue as: #6910 (comment) (details: #6750 (comment)) (new D3D item, RT-5 stop 6)
Depends on: none (it applies to
main). For the boot it matters after #6709, #4531, #6582, #4313 and #4348.Problem
The retail executable calls the device's struct-returning methods with the C ABI, not the PC C++ one. Measured with
game_scarlett_master.exe1.0.2.1 undergta6rt --run(cdb at the first fault): right afterD3D12XboxCreateDevice, the title calls device slot 26GetCustomHeapPropertieswithrcxrdxr81r9DEFAULT, thenUPLOAD)and reads the result from the buffer. That is the C rule: a struct wider than 8 bytes comes back through a hidden first argument. It is consistent with the heap proxy's measured slots 9/10, where the 8-byte handle comes back in RAX, as C returns an 8-byte struct.
d3d12_xs_device.cpp's generic forwarder assumes the PC form (thisin RCX, return buffer in RDX). So it took the caller's stack buffer for the device and faulted readingreal_vtable[26](proxy_slot<26>, offset0xD0). That stops the boot just after device creation.Fix
GetResourceAllocationInfo,D3D12_RESOURCE_ALLOCATION_INFO, 16 bytes) and 26 (GetCustomHeapProperties,D3D12_HEAP_PROPERTIES, 20 bytes) get their own thunks. Slot 26 is measured; slot 25 has the same shape, so the same rule applies (inferred, no call site measured yet).d3d12.h, in the PC form. So, as the heap proxy's 9/10 already do, the thunks accept both forms: whichever of the first two arguments is the device proxy (its first word is the proxy's vtable) isthis, and the other is the return buffer. The buffer is returned in RAX, as both conventions require. A first attempt that took only the C form broked3d12_vulkan_device,d3d12_fence_timingandd3d12_descriptor, which call these slots throughd3d12.h.GetAdapterLuid(an 8-byte LUID). By the same rule the title would expect it in RAX, but no call site is measured yet, so it still forwards in the PC form, anddevice_proxy_testkeeps its PC-form check.device_slot_overriddenlists 25/26, the first-call log names them, and the file comment,d3d12_xs_device.handdocs/design.mdsay what was measured.Tested
device_proxy_test(WARP, no game files): new checks call slots 25 and 26 through raw function pointers in the title's C form (buffer first, device second) forDEFAULT/UPLOAD/READBACKheaps and a buffer description. They compare with the PC device's own answers and check that the buffer comes back in RAX. The same slots are also called throughd3d12.h(PC form). All pass.cteston Windows 11 26200, RX 9070 XT (AMD Windows driver), MSVC 14.44 RelWithDebInfo: 224 of 227 pass. The 3 failures are the same as onmainon this GPU (vk_queue_query_sync,d3d12_texture_tiles,d3d12_pipeline_library_host, reported in GPU test results (one comment per GPU and driver) #166).tests/test_docs*.py: all pass.OpenExistingHeapFromAddress(E_NOTIMPL), the next item.No game data, bytes or traces are included. AI-assisted (Claude Code).
🤖 Generated with Claude Code