upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs/d3d12_command_objects.md
diff options
context:
space:
mode:
authorJan Trencansky <jan.trencansky@protonmail.com>2026-11-24 22:09:38 -0500
committerJan Trencansky <jan.trencansky@protonmail.com>2026-11-24 22:09:38 -0500
commit5115f0887940595aa0f46fed7fc9db28b64151ff (patch)
tree98b4df97d3b97af290331ea9893587e250c0fac0 /docs/d3d12_command_objects.md
parentc8f7515e2e6fb2a2a61eb1e986ee8c6fd4431399 (diff)
parentb07b9ecb09b47fa6496f01ad9d8fe87d205bd5d8 (diff)
Merge main into RT-DIRECT-HEAP-COMPUTE (#1064)
main already supplies the directly indexed heaps to compute dispatches (integration #984, the tree this pull request was split from): with_direct_heaps()/compute_user_data() on Dispatch and the ExecuteIndirect dispatch path, RootArgumentLayout::compute_arguments_end (kNoSgpr for a spilled signature), LEONIDA_COMPUTE_DIRECT_HEAPS=0, and the first form of this test (direct dispatch, indirect after a resource-only rebind, the GPU read through the heap). That form stays. What this pull request adds beyond it is carried onto it: the review-round reports, the extra recorded-argument checks, the census tool and its evidence. Conflicts: - runtime/shims/d3d12_com.cpp: main's with_direct_heaps()/compute_user_data() and its one-argument note_direct_heap_indexing(). Carried: compute_user_data() makes the note itself, so an ExecuteIndirect dispatch with no heap bound is reported too (record_dispatch's own call removed), and a heap with no inline dword left is reported once per heap kind ("compute root arguments leave no inline SGPR for the resource/sampler heap"); a spilled signature (main: kNoSgpr) gets one note of its own. Dropped: the PR's GetEnvironmentVariableA switch (main's direct_heaps_enabled) and its "graphics heap-base SGPR is not supplied" notes (main supplies the graphics heaps). - runtime/shims/d3d12_com.h, runtime/shims/d3d12_vulkan_device.cpp: main's (compute_arguments_end and graphics_arguments_end with their comment; compute_arguments_end only when the compute arguments do not spill). - runtime/test/glsl/cs_user_data.comp: main's; its direct-indexing mode (s5 = 0xFFFFFFFC, heap at s9) is this pull request's, byte for byte. - runtime/test/d3d12_compute_test.cpp: the PR's block replaces main's earlier form of it (a superset: adds the bundle dispatch that inherits the parent's heaps, an indirect dispatch with only the sampler heap, signatures ending at s30 and s31, and the LEONIDA_COMPUTE_DIRECT_HEAPS=0 expectations). - docs/d3d12_vulkan.md: main's section 3.4 (the BatchCull s7 and PreSkin s9 evidence), with the PR's census paragraph (tools/compute_heap_layout_census.py, the seven paired layouts, the heap order as a hypothesis) and the no-room and spill reports. 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.md15
1 files changed, 11 insertions, 4 deletions
diff --git a/docs/d3d12_command_objects.md b/docs/d3d12_command_objects.md
index 5a214e325..1aef12206 100644
--- a/docs/d3d12_command_objects.md
+++ b/docs/d3d12_command_objects.md
@@ -375,9 +375,10 @@ section 3.5a), and the console list has methods well past the PC tail: 71, 73, 8
375FSR DLL. 375FSR DLL.
376 376
377Slot 148 matters beyond the builder: the address it returns is written by the CPU and passed unchanged to the GPU 377Slot 148 matters beyond the builder: the address it returns is written by the CPU and passed unchanged to the GPU
378as a root SRV address, so console upload memory has the same address for the CPU and the GPU. A replacement must 378as a root SRV address, so console upload memory has the same address for the CPU and the GPU. On a PC the two
379return memory whose CPU pointer is also a valid GPU address (for this layer: inside the arena of 379address spaces differ, so `d3d12_xs_device.cpp` carves a bump arena out of persistently-mapped UPLOAD-heap
380[d3d12_vulkan.md §3.3](d3d12_vulkan.md)). 380buffers: the title writes the mapped memory and the six root descriptor setters and the IA/SO view setters
381translate the CPU pointer to the chunk's buffer device address before forwarding.
381 382
382The function at `0xd580` uses the 71/73 pair instead of the slot-146 barrier when the byte at RVA `0xd773c` is set. 383The function at `0xd580` uses the 71/73 pair instead of the slot-146 barrier when the byte at RVA `0xd773c` is set.
383That byte is one of seven bools at `0xd7738`–`0xd773e` in zero-initialised `.bss`. The only accesses to them in 384That byte is one of seven bools at `0xd7738`–`0xd773e` in zero-initialised `.bss`. The only accesses to them in
@@ -764,6 +765,12 @@ Queues and fences are wrapped the same way.
764 object implements but the proxy does not model is logged once and refused. 765 object implements but the proxy does not model is logged once and refused.
765- **The refused tail.** A slot past the public chain, up to the end of the proxy's own table (128 queue and 766- **The refused tail.** A slot past the public chain, up to the end of the proxy's own table (128 queue and
766 64 fence slots, every one a thunk), logs its first four argument words once and returns `E_NOTIMPL`. 767 64 fence slots, every one a thunk), logs its first four argument words once and returns `E_NOTIMPL`.
768- **Fence slot 12.** The one served slot past the chain. The retail executable calls it as
769 `(value, descriptor, flags)` and reads the return as a pointer to the fence's 64-bit completed value: it
770 compares that value with `~0` (device removed) and subtracts the value it waits for. The proxy returns a
771 per-fence mirror. Completion events refresh it immediately. A 10 ms wait timeout also refreshes it if the
772 fence rewinds below the pending event's threshold. Slot 12 and the CPU `Signal` (10) refresh it synchronously.
773 The descriptor's second word is a code pointer, which is not called.
767- **The guard region.** Each table sits at the end of the first page of a 64 KiB reservation, and the rest 774- **The guard region.** Each table sits at the end of the first page of a 64 KiB reservation, and the rest
768 of that reservation is never committed. A slot past the table therefore faults on the vtable read itself, 775 of that reservation is never committed. A slot past the table therefore faults on the vtable read itself,
769 inside the reservation, and a vectored handler logs the slot before the fault goes on. A vtable read that 776 inside the reservation, and a vectored handler logs the slot before the fault goes on. A vtable read that
@@ -830,7 +837,7 @@ command object.
830| Item | Why it is blocked | 837| Item | Why it is blocked |
831|---|---| 838|---|---|
832| `PresentX` | No slot, signature, plane struct or swapchain/plane parameters. Prior art gives only names, the 2-plane/8-view limits and four flag names. | 839| `PresentX` | No slot, signature, plane struct or swapchain/plane parameters. Prior art gives only names, the 2-plane/8-view limits and four flag names. |
833| `CreateCommandQueueX` | No slot or parameter layout; only the UMD message and an inferred shape. | 840| `CreateCommandQueueX` | No slot or parameter layout; only the UMD message and an inferred shape. The retail title calls device slot 48 as (desc, riid, out) with a 32-byte desc (#6954), which differs from the (pDesc, pShaderQueueParams, riid, out) shape inferred above. |
834| `SuspendX` / `ResumeX` | No slot or signature. | 841| `SuspendX` / `ResumeX` | No slot or signature. |
835| Xbox queue/list/fence/allocator slot deviations | No runtime binary and no game executable; the package has no queue, fence or allocator client, and its only command-list client is the BVH builder. | 842| Xbox queue/list/fence/allocator slot deviations | No runtime binary and no game executable; the package has no queue, fence or allocator client, and its only command-list client is the BVH builder. |
836| Builder's list field `+0x350` | Read once (`0x1d877`) and not explained by the inline buffer of section 3.5a, which covers `+0x18`, `+0x28`, `+0x30`, `+0x140`, `+0x141`, `+0x344` and `+0x544`. | 843| Builder's list field `+0x350` | Read once (`0x1d877`) and not explained by the inline buffer of section 3.5a, which covers `+0x18`, `+0x28`, `+0x30`, `+0x140`, `+0x141`, `+0x344` and `+0x544`. |