Repository navigation
d3d12: answer CheckFeatureSupport(D3D12_OPTIONS) asked with the console's larger structure (D3D-426) - #4026
d3d12: answer CheckFeatureSupport(D3D12_OPTIONS) asked with the console's larger structure (D3D-426)#4026mariuslozo-boop wants to merge 1 commit into
Conversation
…le's larger structure A retail console title asks for D3D12_OPTIONS with 0x40 bytes where the PC structure is 0x3C and stops on E_INVALIDARG (measured by the XCL project; GTA VI is not measured). A size above the PC structure now gets the PC fields, every byte after them zeroed and S_OK, in the Vulkan device and in the Xbox-ABI proxy's device slot 13 over a PC runtime (WARP refuses 0x40, which device_proxy_test prints). A smaller size and every other feature keep the exact-size rule: no other console size is measured, and a console structure may carry input fields that zeros would answer wrongly (shims/d3d12_console_feature.h). The first such call logs its size. Tests: one shared check (test/d3d12_options_size_check.h) runs on the raw Vulkan device, the proxy over it, the standalone Vulkan device and the proxy over WARP: 0x3C, 0x3D, 0x40 with a 0xCD-filled buffer, 0x44, 0x80, 0x1000 and 0x10000 (guard bytes after the structure untouched), smaller sizes and no buffer refused, other features still E_INVALIDARG. device_proxy_test also calls slot 13 with garbage in the upper halves of the 32-bit arguments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested
AI-assisted (Claude). No game files. |
|
Tested
|
|
Independent pass at
All tests ran without game files. |
|
Tested
AI-assisted (Claude Code). No game files. |
|
Adjacent False “supported”:
False “unsupported”:
Missing:
Correction to the audit: |
|
Verified
Boot risk: the |
|
Rebased onto main Conflicts were exactly the two test hunks:
Retested on Windows 11, RTX 5070 Ti, MSVC 19.44, Ninja, RelWithDebInfo, Vulkan 1.4.363.0:
Remaining caveat unchanged: the 0x40 layout is XCL's XDefiant measurement, not GTA VI; the extra 4 bytes are zeroed by inference, so a title reading them as a nonzero output can still misbehave after |
|
Heads-up: this PR and #4695 both replace device slot 13 ( I merged Kam471's rebase (6ec9d70) into #4695's branch and resolved it so both behaviours stay: this PR's console-sized D3D12_OPTIONS answer runs first, then #4695 logs the answer (for that call the log line now shows the zeroed extra bytes). The leftover dispatcher branch is removed, and the boot.md row 11 text is merged. Resolution: kingzzim7-create@c7defe9f9 (branch Result, fresh build on Windows 11 / RTX 4060 Ti: 11/11 pass (device_proxy, device_proxy_feature_log, device_proxy_trace, xs_proxy_mock + 3 variants, root_sig, root_signature, root_signature_oracle, d3d12_vulkan_device); doc tests 86 passed. Whichever of the two lands first, the other can take this resolution as-is. AI-assisted (Claude) |
|
Rebased onto current
You can fast-forward/force-update your branch to this head, or cherry-pick it ( |
Claimed in the coordination issue as: D3D-426 (claim).
What and why
A retail console title calls
CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS)with 0x40 bytes and stops when it getsE_INVALIDARG. The PC structure is 0x3C. This was measured by the XCL project on XDefiant. GTA VI is not measured, so this is a compatibility lead. Both backends refused that size:d3d12_vulkan_device.cpp(size != sizeof);device_proxy_testnow prints that.The change:
D3D12_OPTIONSrequest larger than the PC structure gets the PC fields, every byte after them zeroed, andS_OK, on both backends.FORMAT_SUPPORTandFEATURE_LEVELSdo) that zeros would answer wrongly. The rule and how to extend it are inruntime/shims/d3d12_console_feature.handdocs/d3d12_vulkan.md§4.1.E_INVALIDARGinstead of forwarding it, because WARP faulted on that. If the PC runtime fails, its error is returned and the caller's buffer is left untouched.docs/boot.mdrow 11).Tested
Windows 11, RTX 5070 Ti (driver 616.92), MSVC 19.44, Vulkan SDK 1.4.363.0, RelWithDebInfo, on
mainaa2988cc.ctest: 145/145 passed. The skips are the usual ones that need game data, SDL3 or tools.runtime/test/d3d12_options_size_check.h): it runs on the raw Vulkan device, the proxy over it, the standalone Vulkan device and the proxy over WARP, and covers:OPTIONS1–3,ARCHITECTURE,GPU_VIRTUAL_ADDRESS_SUPPORTandFORMAT_SUPPORTstillE_INVALIDARGwhen oversized.device_proxy_test: also calls slot 13 with garbage in the upper halves of the arguments.test_docs_links,test_docs_repo_paths,test_docs_list_items,test_docs_design_rows,test_i18n_indexandtest_text_write_line_endingspass.d3d12.lib/dxgi.lib, sodevice_proxy_testneeded-DD3D12_LIBRARY/-DDXGI_LIBRARYat configure time. No repository change.Provenance: the 0x40 size and the title's behaviour are facts from XCL's HANDOFF.md (GPL-2.0-only). No XCL code was read for this change, and none is in it.
Checklist
docs/design.md, with how it was confirmed. (No translator change.)AI-assisted (Claude Code).
🤖 Generated with Claude Code