diff options
| author | AimLogin <4jt8mn8wjn@privaterelay.appleid.com> | 2026-11-22 15:11:53 +0100 |
|---|---|---|
| committer | AimLogin <4jt8mn8wjn@privaterelay.appleid.com> | 2026-11-22 15:11:53 +0100 |
| commit | 2123a02506f16cab63c676dbb029edd0bbe859a2 (patch) | |
| tree | 66e5632dcbd98f513f561938ac09331574d7d2ea /docs/d3d12_command_objects.md | |
| parent | 89b047cd8fab50675a43d76722a6a8a881f55dc2 (diff) | |
Runtime: Xbox-ABI proxy for the command allocator (device slot 9)
Device slot 9 (CreateCommandAllocator) now returns an allocator proxy,
the fourth command object after the queue and fence (BUILD-231) and the
list (D3D-136): the public chain (9 slots, Reset at 8) is forwarded, a
slot past it up to the end of a 64-slot table is logged and refused with
E_NOTIMPL, and a read past the table faults in its own guard region. The
console allocator's extra methods are not measured and not guessed.
A list takes the title's allocator in CreateCommandList and Reset, so a
proxy is only safe where the list side resolves it. Slot 9 therefore
wraps an allocator only when it answers kLeonidaCommandAllocatorTag (the
Vulkan layer's CommandAllocator, whose from() resolves the proxy for both
calls); a PC runtime allocator is handed out unchanged, logged once,
until a command-list proxy unwraps it at Reset. Allocator proxies are
unwrapped in the residency calls like heap, queue and fence proxies.
Device slot 12 is not touched.
Tests: allocator_proxy_test (WARP, a hardware adapter, the Vulkan device:
forwarding, refused tail, guard region, identity, D3D12's allocator rules,
a list created and Reset on the proxy with GPU copies through the queue
and fence proxies read back), mock cases for allocators with and without
the tag and their failure paths, and device_proxy_test's slot-9
expectations. No game files.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs/d3d12_command_objects.md')
| -rw-r--r-- | docs/d3d12_command_objects.md | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/d3d12_command_objects.md b/docs/d3d12_command_objects.md index a55c3d964..9d2044272 100644 --- a/docs/d3d12_command_objects.md +++ b/docs/d3d12_command_objects.md | |||
| @@ -563,6 +563,26 @@ Queues and fences are wrapped the same way. | |||
| 563 | and a heap proxy given to a list's `SetDescriptorHeaps` reaches the real list unchanged. The command-list | 563 | and a heap proxy given to a list's `SetDescriptorHeaps` reaches the real list unchanged. The command-list |
| 564 | proxy of §3.5a adds the unwrap at both places. | 564 | proxy of §3.5a adds the unwrap at both places. |
| 565 | 565 | ||
| 566 | Command allocators get the same kind of proxy: device slot 9 (`CreateCommandAllocator`) returns one. | ||
| 567 | |||
| 568 | - **What is forwarded.** The public chain, 9 slots: the base chain and `Reset` at 8. A slot past it, up to the | ||
| 569 | end of a 64-slot table, is logged and refused, and a read past the table faults in its own guard region. | ||
| 570 | The console allocator's extra methods are not measured. | ||
| 571 | - **Where a list takes it.** A list takes an allocator from the title in `CreateCommandList` and `Reset`, so | ||
| 572 | the proxy is safe only where the list side resolves it. Slot 9 therefore wraps an allocator only when it | ||
| 573 | answers `kLeonidaCommandAllocatorTag` (`d3d12_xs_device.h`). That is the Vulkan layer's own allocator, whose | ||
| 574 | `CommandAllocator::from()` resolves the proxy for both list calls. | ||
| 575 | - **On the host runtime.** A PC runtime allocator comes back unwrapped, logged once, because the PC runtime's | ||
| 576 | lists would take a proxy for their own allocator. A command-list proxy that unwraps at `Reset` (§3.5a) is | ||
| 577 | what lets the host backend wrap allocators too. | ||
| 578 | - **Residency.** An allocator is a pageable, so `MakeResident`/`Evict`/`SetResidencyPriority`/ | ||
| 579 | `EnqueueMakeResident` unwrap allocator proxies like heap, queue and fence proxies. | ||
| 580 | |||
| 581 | `allocator_proxy_test` checks this on the Vulkan device and on the host runtime, and the mock test checks it | ||
| 582 | over allocators with and without the tag. On the Vulkan device it checks forwarding, the refused tail, the guard | ||
| 583 | region, identity, and D3D12's allocator rules through the proxy, and runs a list created and `Reset` on the | ||
| 584 | proxy whose copies go through the queue and fence proxies and are read back. | ||
| 585 | |||
| 566 | Which of this is measured: the slot numbers and signatures are the SDK's (public). That the console | 586 | Which of this is measured: the slot numbers and signatures are the SDK's (public). That the console |
| 567 | keeps the public queue and fence slots, and device slots 8/32/36/75, is an assumption the package cannot | 587 | keeps the public queue and fence slots, and device slots 8/32/36/75, is an assumption the package cannot |
| 568 | test, as above. The proxies make a wrong assumption visible in the log; they do not prove it right. | 588 | test, as above. The proxies make a wrong assumption visible in the log; they do not prove it right. |