Repository navigation
Conversation
…TCH (slot 41) The retail title creates five one-argument command signatures with no root signature at startup (device slot 41, CreateCommandSignature at its PC position). One has the console argument type 105 and a 12-byte stride, next to a DISPATCH and a DISPATCH_MESH of 12 bytes. The PC layer refuses the unknown type, which is stop 19 of the RT-5 boot measurements. Read statically from the title's call sites (shapes only): the two ExecuteIndirect sites of that signature pass MaxCommandCount 1 and an offset into the same argument buffer as the DISPATCH sites. Right before, they set the same compute state as the DISPATCH path (pipeline, compute root signature, tables, constants, SRV and UAV); they record on a second command list of the title's context. So the argument is taken as a D3D12_DISPATCH_ARGUMENTS. Slot 41 now has its own handler. A description that holds type 105 is copied with that type replaced by DISPATCH (logged once). Any other description is forwarded as the same pointer. What the console does differently for type 105 is left open in docs/d3d12_vulkan.md (section 4.9). xs_proxy_mock_test: a two-argument description (a root constant, then type 105) reaches the PC slot 41 as a copy with DISPATCH, the same stride, count, root signature, IID and output, and the caller's description is untouched; a PC description is passed through unchanged. With main's d3d12_xs_device.cpp the new check fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
105 is outside D3D12_INDIRECT_ARGUMENT_TYPE's range [0, 15], so clang-cl rejects a constant expression that casts it to the enum (reported by umnitus on ItsNotRexed#7163). The handler now reads each argument's Type field as a uint32_t through memcpy and compares it with 105; the test writes and reads the raw value the same way, and the mock records it the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…returns E_NOTIMPL
Grimkaaah
left a comment
There was a problem hiding this comment.
Independent Linux CPU review
What changed: d3d12_xs slot 41 maps Xbox indirect type 105 → DISPATCH, and retries DISPATCH_MESH as DISPATCH on E_NOTIMPL (no mesh shaders). Docs row added.
Checked: diff + xs_proxy_mock_test.cpp present. Logic matches the documented retail startup signatures.
No game files. Full Windows mock test not run on this Linux host.
|
Verified on native Windows 11 (
AI-assisted. |
|
A measurement on this PR's premise that Retrying the description as |
|
Thanks for the RX 5700 / WARP measurement, @dracbat — that's a great catch. I had inferred Your point about Handling Also thanks @smowlyy for verifying 6/6 AI-assisted. |
|
The Intel UHD 770 retail stop reproduces here: after warming all 52 actual BVH PSOs, startup gets past cold compilation, then reaches this signature boundary and the title reports E_NOTIMPL. One semantic concern with retrying as DISPATCH: ExecuteIndirect records its kind from the returned signature, so DISPATCH takes the compute-pipeline/user-data path, whereas mesh_compute is still a graphics PSO that needs both the compute pass and the slot draw. Identical 12-byte arguments do not make those commands interchangeable. #5899 implements the actual indirect mesh path: on my physical no-extension Intel its 30 indirect records and six compute-written records have zero mismatches, though its direct multi-dispatch fixture still has a separate 256-pixel failure. Could this use the real backend support instead of changing the signature kind? |
Claimed in the coordination issue as: new RT/D3D item (RT-5 stop 19 follow-up), #9065 (comment)
Depends on: #7163
Summary
When the Xbox title's renderer initialization creates its five 1-argument command signatures through
d3d12_xsdevice slot 41 (CreateCommandSignature), the fifth signature usesD3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH(type 9, 12-byte{ThreadGroupCountX, ThreadGroupCountY, ThreadGroupCountZ}argument buffer).On GPUs or drivers without
VK_EXT_mesh_shader(such as AMD RDNA1 under--mesh-compute), the underlying PCID3D12Device::CreateCommandSignaturereturnsE_NOTIMPLforD3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH(matching the PC D3D12 runtime contract andd3d12_mesh_test). Because the caller checks theHRESULTof all five command signatures and hits an assertion (int3) if any fails, failing the fifth signature aborts the rest of that renderer initialization function and leaves its per-frame query ring buffer unallocated, causing a null-dereference fault on frame 1 (write 0x20).This PR teaches
proxy_create_command_signature(device slot 41 inruntime/shims/d3d12_xs_device.cpp) to retry once with a local copy ofD3D12_COMMAND_SIGNATURE_DESCreplacingD3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESHwithD3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH(which shares the same 12-byte{ThreadGroupCountX, Y, Z}indirect argument layout) when the underlying PC device returnsE_NOTIMPL, and logs the fallback once.Changes
runtime/shims/d3d12_xs_device.cpp: inproxy_create_command_signature(device slot 41), if the description containsD3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESHand the PC device returnsE_NOTIMPL, retry once with a copy replacingDISPATCH_MESHwithDISPATCHand log a one-time diagnostic.runtime/test/xs_proxy_mock_test.cpp: add a test verifying that when the mock PC device refusesDISPATCH_MESHwithE_NOTIMPL, slot 41 retries once withDISPATCH, succeeds, and leaves the caller's input description unmodified.docs/d3d12_vulkan.md: document the slot 41DISPATCH_MESH->DISPATCHfallback onE_NOTIMPLin §4.9.Testing
VK_EXT_mesh_shader), Mesa RADV, Linux 7.3.5-2-cachyos, Wine 11.22, cross-compiled withclang-cl 23.1.5+lld-linkagainst Windows SDK10.0.26100.xs_proxy_mock_test.exeacross all 6 modes ("",--env-slots,--env-slots-invalid,--fail-virtualalloc,--fail-virtualprotect,--fail-veh) ->PASS (9 allocations refused on purpose).RX 5500Mwith--mesh-computeSPIR-V corpus) combined with theladder-framestack + xmem: map consecutive physical pages as one view, so the retail boot's 100,000-page XMemMapPhysicalPages fits the title's hang watchdog under Wine #7584, all five renderer-initCreateCommandSignaturecalls succeed (0 int3_skipped), reaching 349,385 D3D12 calls over 60 s (19,134 Close ok,18,509 Signal ok,0exceptions).python3 -I scripts/check_no_game_data.py docs/d3d12_vulkan.md runtime/shims/d3d12_xs_device.cpp runtime/test/xs_proxy_mock_test.cpp(exit 0)python3 -I tests/test_check_no_game_data.pypython3 -I tests/test_docs_list_items.pypython3 -I tests/test_docs_repeated_lines.pypython3 -I tests/test_docs_table_ids.py