diff options
| author | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-24 22:12:48 -0500 |
|---|---|---|
| committer | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-24 22:13:02 -0500 |
| commit | 3ee0037fd3accba459d0d5ecd8acad831174d4d7 (patch) | |
| tree | 55953ce44091103e4f7c4a2f45490be961282b27 /docs/d3d12_command_objects.md | |
| parent | 9b8707c03dabb59ba2e29b9b0749d3c3eb1f3903 (diff) | |
| parent | 5115f0887940595aa0f46fed7fc9db28b64151ff (diff) | |
Merge main into RT-DIRECT-HEAP-GRAPHICS (#1232)
This merges #1064 as prepared (its head + a merge of main), so it brings #1232 up to date with main and
with #1064. #1232's branch carried #974 (merged into main since) and an older head of #1064 (7c47fd946).
main already supplies the directly indexed heaps to graphics draws (integration #984):
graphics_user_data() on DrawInstanced, DrawIndexedInstanced and DispatchMesh, at
RootArgumentLayout::graphics_arguments_end (pack_stage(Stage::Pixel)'s end_sgpr, set when the console
layout places the signature), LEONIDA_GRAPHICS_DIRECT_HEAPS=0, its notes for a signature on the s0
layout or one that fills s31, and d3d12_graphics_direct_heaps_test (recorded draws and the VS/PS GPU
reads). That form stays. What this pull request adds beyond it is carried onto it: the mesh case.
Conflicts (all taken from #1064's merged branch, then the PR's mesh parts carried over):
- runtime/shims/d3d12_com.cpp: main's graphics_user_data()/with_direct_heaps() and notes. The PR's own
graphics_user_data(), GetEnvironmentVariableA switch and no-room notes are main's in another form and
dropped. Carried: the comment says a mesh shader reads push dword d as s(d + 8) through #974's window,
so it gets the heaps after its arguments from s16 (main's comment still said the mesh stage gets none);
and DispatchMesh reports once when a heap falls past the mesh window (push dword 24 and up, s32 for the
mesh shader), the case raised in the review of #1232 (mesh_ok accepts arguments up to push dword 24).
- runtime/shims/d3d12_com.h, runtime/shims/d3d12_vulkan_device.cpp: main's (graphics_arguments_end from
pixel.end_sgpr; the PR set it from its Spill::block form, which main did not take from #974).
- runtime/test/glsl/cs_user_data.comp: main's (identical direct-indexing mode).
- docs/d3d12_vulkan.md: main's section 3.4 with #1064's compute paragraph; the graphics paragraph's
"a mesh shader ... is not modelled" replaced by the mesh window position, cited to issue #14 comment
7143020922 as a report not reproduced here, the window-overflow note and the mesh test.
- runtime/test/d3d12_mesh_test.cpp (no conflict): the PR's recorded-argument checks kept (vertex and mesh
draw with 4 constants, resource-only rebind, 23 constants, 30 constants); the 30-constant comment now
says it keeps pack()'s s0 layout on main.
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 | 15 |
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 | |||
| 375 | FSR DLL. | 375 | FSR DLL. |
| 376 | 376 | ||
| 377 | Slot 148 matters beyond the builder: the address it returns is written by the CPU and passed unchanged to the GPU | 377 | Slot 148 matters beyond the builder: the address it returns is written by the CPU and passed unchanged to the GPU |
| 378 | as a root SRV address, so console upload memory has the same address for the CPU and the GPU. A replacement must | 378 | as a root SRV address, so console upload memory has the same address for the CPU and the GPU. On a PC the two |
| 379 | return memory whose CPU pointer is also a valid GPU address (for this layer: inside the arena of | 379 | address 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)). | 380 | buffers: the title writes the mapped memory and the six root descriptor setters and the IA/SO view setters |
| 381 | translate the CPU pointer to the chunk's buffer device address before forwarding. | ||
| 381 | 382 | ||
| 382 | The function at `0xd580` uses the 71/73 pair instead of the slot-146 barrier when the byte at RVA `0xd773c` is set. | 383 | The function at `0xd580` uses the 71/73 pair instead of the slot-146 barrier when the byte at RVA `0xd773c` is set. |
| 383 | That byte is one of seven bools at `0xd7738`–`0xd773e` in zero-initialised `.bss`. The only accesses to them in | 384 | That 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`. | |