Skip to content

d3d12_xs: route command queue slot 35 to ExecuteCommandLists - #7286

Open
Vadson159 wants to merge 1 commit into
ItsNotRexed:mainfrom
Vadson159:recomp/queue-slot-35-execute
Open

Vadson159 wants to merge 1 commit into
ItsNotRexed:mainfrom
Vadson159:recomp/queue-slot-35-execute

Conversation

@Vadson159

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue: #7049 (comment)

Depends on: none (applies directly to main; sharing queue_execute_command_lists between slots 10 and 35 also keeps future command-list unwrapping such as #7076/#2490 in one place).

What and why

Per @KkelebekK's RT-5 measurement (#7049 (comment)), the retail executable calls command queue slot 35 as (count, lists) — a console ExecuteCommandLists variant, not PresentX. Previously ChildProxy<ChildKind::queue> only forwarded slots 0..18 (kQueuePublicSlots = 19) and refused slot 35 with E_NOTIMPL.

  • runtime/shims/d3d12_xs_device.cpp / runtime/shims/d3d12_xs_device.h:
    • Route ChildKind::queue slot 35 (kQueueExecuteCommandListsX) to PC slot 10 (kQueueExecuteCommandLists) via a shared queue_execute_command_lists helper, zero-extending UINT count cleanly to 64 bits and returning 0 (S_OK / ignored void).
    • Record slot 35 as XboxID3D12CommandQueue::ExecuteCommandListsX in child_public_name<ChildKind::queue> / d3d12_trace and expose queue_slot_overridden(unsigned slot).
  • runtime/test/queue_proxy_test.cpp:
    • Exercise queue slot 35 on both empty command lists (check_slots) and a GPU upload -> default -> readback copy round-trip with readback verification (check_xbox_client), plus queue_slot_overridden checks and skipping overridden slots in the E_NOTIMPL tail loop.
  • runtime/test/xs_proxy_mock_test.cpp:
    • Add check_xbox_queue_slots() verifying queue_slot_overridden, slot 35 hit/first-call tracking, routing to mock PC slot 10 without reaching mock slot 35, upper-32-bit garbage masking on count, and skipping overridden slots in check_tail.

Tested

Windows 11, MSVC (RelWithDebInfo), AMD Radeon RX 9070 XT + WARP + Vulkan, no game files:

  • scripts\build_runtime.ps1: clean incremental build (113/113 targets, gta6rt.exe linked).
  • .\runtime\build\queue_proxy_test.exe --trace-d3d12: 3 backend(s) passed (host WARP, host AMD Radeon RX 9070 XT, Vulkan).
  • .\runtime\build\xs_proxy_mock_test.exe: xs_proxy_mock_test: PASS (9 allocations refused on purpose).
  • ctest --test-dir runtime/build -C RelWithDebInfo -R "proxy|allocator|root_sig|loader|xmem|frame_pacer|tiny|d3d12_xs|dxgi_device|xbox_present" --output-on-failure: 39/39 passed (0 failed).
  • python -I scripts/check_no_game_data.py runtime/shims/d3d12_xs_device.h runtime/shims/d3d12_xs_device.cpp runtime/test/queue_proxy_test.cpp runtime/test/xs_proxy_mock_test.cpp, git diff --check, and LF line-ending check: clean.
  • Not tested locally: VK_LAYER_KHRONOS_validation (layer not installed on this host) and the retail executable itself (no game files).

AI-assisted: yes.

@soldsawn

Copy link
Copy Markdown

Independent Windows 11 / MSVC check at head e925b63455:

  • Environment: Windows 11, MSVC 19.44.35230.0 (CMake + Ninja, RelWithDebInfo), NVIDIA GeForce RTX 4060 Laptop GPU (driver 32.0.16.1714).
  • Built targets: queue_proxy_test, xs_proxy_mock_test, device_proxy_test, gta6rt — all built cleanly.
  • Test results:
    • queue_proxy_test.exe: 3 backend(s) passed (including queue slot 35 ExecuteCommandLists GPU execution & readback).
    • xs_proxy_mock_test.exe: PASS (9 allocations refused on purpose) (queue slot 35 routes ExecuteCommandLists(count, lists) to PC slot 10 with UINT count masking).
    • device_proxy_test.exe: OK (0 failures).

AI-assisted.

@MartinIndra02

Copy link
Copy Markdown

Independent Windows + GPU test of e925b6345: pass.

Setup: Windows 11 x64, MSVC 19.44.35220 (RelWithDebInfo, Windows SDK 10.0.26100.0), NVIDIA GeForce RTX 3080 (driver 32.0.16.2124 / 621.24), Vulkan SDK 1.4.363.1, no game files.

  • xs_proxy_mock_test.exe: PASS (exit 0) — check_xbox_queue_slots (slot 35 routing to PC slot 10, UINT count upper-32-bit masking, queue_slot_overridden) and tail checks passed.
  • queue_proxy_test.exe --trace-d3d12 (host WARP, host RTX 3080, Vulkan RTX 3080): 3 backend(s) passed (exit 0), trace confirms XboxID3D12CommandQueue::ExecuteCommandListsX -> ID3D12CommandQueue::ExecuteCommandLists ok and GPU copy readback round-trip through slot 35.

AI-assisted review/test.

@TheHoracio

Copy link
Copy Markdown
Contributor

Integration note (AI-assisted; no game files): with #2490 merged, the early return for queue slot 10 skips #2490's list-proxy unwrapping.

child_slot now returns queue_execute_command_lists(self, a1, a2) for Slot == kQueueExecuteCommandLists before the UnwrappedArray block that replaces each console list proxy with its real list. With #2490 the lists a title (or allocator_proxy_test/queue_proxy_test) records come from the device proxy as console-shaped proxies, so the PC queue gets proxy pointers: allocator_proxy fails (readback->Map after the copy, later an access violation) and queue_proxy fails second->GetCompletedValue() == 0 on host WARP. Both pass on main and on #2490 alone.

Unwrapping inside queue_execute_command_lists fixes both slots (10 and your 35) and keeps your count masking:

UnwrappedArray unwrapped;
if (!unwrapped.fill(lists_word, static_cast<std::uint64_t>(static_cast<UINT>(count_word))))
    return hr_to_u64(E_OUTOFMEMORY);
if (unwrapped.data()) lists_word = unwrapped.data();

The slot 35 mock test then needs null (or real mock) entries instead of 0x12340000/0x56780000, since the entries are read, and args[10][1] is the unwrapped copy rather than the caller's array. Whichever of #2490/#7286 lands second needs this.

@jlric

jlric commented Nov 23, 2026

Copy link
Copy Markdown

Retail confirmation of the #2490 integration issue on CachyOS / Wine 11.22, RTX 4070 (620.73.04). Routing slot 35 reaches the PC queue, which rejects the wrapped list. Unwrapping it with list_proxy_real_list before the Vulkan queue resolves the list changes ExecuteCommandLists from failure to success on the same stack. AI-assisted testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants