You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
d3d12_xs: use queried interfaces for slots 86, 101 and 108 - #8517
The handlers added by #7201 detect newer device interfaces through QueryInterface, but call slots 47, 62 and 68 on the original base device pointer. COM permits the queried interface to have a distinct pointer and vtable.
Change
Acquire Device2, Device5 or Device8 for the respective Xbox slot 86, 101 or 108, call through the returned interface, and release the acquired reference. The creation handlers preserve backend HRESULTs. The allocation handler keeps the existing 56-byte descriptor conversion and both caller ABI forms.
A synthetic COM fixture exposes one IUnknown identity at separate base and extended-interface pointers. It checks receiver selection, creation failure propagation, both allocation return-buffer orders, and reference balance.
This branch preserves all four commits of #7201 through 8e765684ce6a4c9a8c511d0662ec939c4b50e850. The follow-up itself is the two-file commit 07b32da9049de906a9aa556b594f0c7cdd13c0d9.
Validation
Windows x64, MSVC 19.44, SDK 10.0.26100, RelWithDebInfo:
With this fix: 8/8 proxy CTests pass, including the distinct-interface regression, existing interface refusals, both slot-108 caller ABIs, 1,025-entry descriptor coverage, and the WARP device tests.
No-game-data check and git diff --check pass.
Independent source review confirmed the queried receivers and balanced references.
CPU mocks and WARP only. No hardware GPU or game files used.
Tested 07b32da90 on Windows 11 (10.0.26300), NVIDIA GeForce RTX 5070 (driver 32.0.16.2101, subgroup 32), MSVC with SDK 10.0.26100, Release, merged onto main867d922f0 together with #8542, #8529, #8517, #8513, #8512 and #8530 (no conflicts): pass.
device_proxy, device_proxy_trace and xs_proxy_mock with all 5 variants pass.
The QI/Release pairs in slots 86/101/108 are balanced, and the test checks extension->refs == 0 after both the success and failure calls. A few gaps:
The same assumption is still made elsewhere. The comment at runtime/shims/d3d12_xs_device.cpp:1494 says an extended interface's vtable may differ from the base device's. Other paths still index real_vtable past slot 44: the generic thunk (:1683, every Device1–14 slot not routed explicitly), proxy_unwrapping_call for 45/46/50 (:1120), and slot 75 / Device9 CreateCommandQueue1 (:1229). If the premise holds, they are wrong too.
The QI failure path doesn't log and has no test.:1496/:1511 return a bare E_NOINTERFACE, and :1578 returns {UINT64_MAX, 0} without a message. Other refusals go through refuse_beyond_device (E_NOTIMPL + one-time log, :1125). Please add a mock where QI(Device2/5/8) fails.
There is a QI per call on slot 108, which runs for every placed-resource sizing. Querying Device2/5/8 once in create_device_proxy (:1754, where detect_slot_count already QIs) and releasing them on teardown would avoid this. They never change after creation, so no lock is needed.
AI-assisted (Claude Code). Windows 11 x64, MSVC 19.44.35220, Ninja RelWithDebInfo, NVIDIA GeForce RTX 3080 driver 621.24 / 32.0.16.2124 (host D3D12, WARP, and the Vulkan layer).
Head 07b32da90, merged locally with current main867d922f0 (docs/d3d12_vulkan.md auto-merged).
Test
Result
device_proxy_test.exe
exit 0, device_proxy_test: OK (0 failures), including device slot 86 is the CreatePipelineState override, ... 101 is the CreateStateObject override, ... 108 is the GetResourceAllocationInfo2 override
xs_proxy_mock_test.exe
exit 0, PASS (9 allocations refused on purpose)
allocator_proxy_test.exe
exit 0, 3 backend(s) passed
Code check:
Slot 108 normalizes Xbox layout words to ROW_MAJOR (buffers) / UNKNOWN (textures), the same as slot 76 proxy_create_resource does for committed resources (d3d12_xs_device.cpp around line 1469). So allocation info and the later creation see the same layout.
Both return-buffer orders are handled through is_device_proxy.
The 0x1FF flag mask keeps every PC D3D12_RESOURCE_FLAGS bit up to RAYTRACING_ACCELERATION_STRUCTURE.
No issues found.
FYI: #7923 / #8252 / #8258 also change proxy_slot in this file. Whichever merges later should be rebuilt against the others.
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
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.
Depends on: #7201
D3D-694 follow-up. Claim: #8344 (comment)
Problem
The handlers added by #7201 detect newer device interfaces through QueryInterface, but call slots 47, 62 and 68 on the original base device pointer. COM permits the queried interface to have a distinct pointer and vtable.
Change
Acquire Device2, Device5 or Device8 for the respective Xbox slot 86, 101 or 108, call through the returned interface, and release the acquired reference. The creation handlers preserve backend HRESULTs. The allocation handler keeps the existing 56-byte descriptor conversion and both caller ABI forms.
A synthetic COM fixture exposes one IUnknown identity at separate base and extended-interface pointers. It checks receiver selection, creation failure propagation, both allocation return-buffer orders, and reference balance.
This branch preserves all four commits of #7201 through
8e765684ce6a4c9a8c511d0662ec939c4b50e850. The follow-up itself is the two-file commit07b32da9049de906a9aa556b594f0c7cdd13c0d9.Validation
Windows x64, MSVC 19.44, SDK 10.0.26100, RelWithDebInfo:
git diff --checkpass.CPU mocks and WARP only. No hardware GPU or game files used.