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-25 06:43:20 -0500
committerJan Trencansky <jan.trencansky@protonmail.com>2026-11-25 06:43:20 -0500
commitf005d7ab223ef10adf404d62272542bf3a90f0da (patch)
tree21c04900270cada41c6cfe0dca8964790a3a0066 /docs/d3d12_command_objects.md
parent924966e2fbde9ae0ac96dcd433803047505efa2f (diff)
Adapt #622 to #1723: the slot 71-74 rows say who writes and who waits
#622's rows had slots 73 and 74 as no-ops and the GPU-label path as the only writer of 71 and 72. Under #1723 the list values record all four for the lists they track (waits included), and LEONIDA_GPU_LABELS=1 writes 71/72 only for the others. The command-object table, the value write paragraph, §5.5 of the console ABI notes and the README row now say so, and name the arena and xmem fallbacks (src/value_write_sink.h). 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.md13
1 files changed, 9 insertions, 4 deletions
diff --git a/docs/d3d12_command_objects.md b/docs/d3d12_command_objects.md
index 86660a793..36a02e874 100644
--- a/docs/d3d12_command_objects.md
+++ b/docs/d3d12_command_objects.md
@@ -565,10 +565,10 @@ shape and the shift around them, but the shape alone does not single the method
565| 55 (`+0x1b8`) | **51** | `DiscardResource` | `(resource, null)` at `0x6dcb`, after the pending barriers are flushed through slot 26 | 565| 55 (`+0x1b8`) | **51** | `DiscardResource` | `(resource, null)` at `0x6dcb`, after the pending barriers are flushed through slot 26 |
566| 59 (`+0x1d8`) | — | console only (shape) | four calls, two shapes: `(1, blob, size)` at `0x6b5a` and `0x6d53`, the blob a run of qwords whose first is `0xf3080 \| (qword count & 0x7f)`; and `(0, &qword, 8)` with the qword 1 at `0x6e52` and `0x6eb8`, only when a profiling bit of the context is set (`0x6e2a`). The first argument is set as a byte (`mov dl, 1` / `xor edx, edx`). It looks like one slot for both ends of a GPU event; no public method takes a bool first. With 55 at +4 and 61 at +2, the two slots the console lacks are among 56–60 | 566| 59 (`+0x1d8`) | — | console only (shape) | four calls, two shapes: `(1, blob, size)` at `0x6b5a` and `0x6d53`, the blob a run of qwords whose first is `0xf3080 \| (qword count & 0x7f)`; and `(0, &qword, 8)` with the qword 1 at `0x6e52` and `0x6eb8`, only when a profiling bit of the context is set (`0x6e2a`). The first argument is set as a byte (`mov dl, 1` / `xor edx, edx`). It looks like one slot for both ends of a GPU event; no public method takes a bool first. With 55 at +4 and 61 at +2, the two slots the console lacks are among 56–60 |
567| 61 (`+0x1e8`) | **59** | `ExecuteIndirect` | `(signature, 1, argument buffer, offset, null, 0)` at `0x59a0` | 567| 61 (`+0x1e8`) | **59** | `ExecuteIndirect` | `(signature, 1, argument buffer, offset, null, 0)` at `0x59a0` |
568| 71 (`+0x238`) | — | console only | `Write32BitValueBottomOfPipeX(address, u32 value, flush, flags)`: the 32-bit value, written into the title's memory once the submission that carried the list has completed on the GPU | 568| 71 (`+0x238`) | — | console only | `Write32BitValueBottomOfPipeX(address, u32 value, flush, flags)`: the 32-bit value, written into the title's memory once the list's work has run (the list values, [d3d12_xs_console_abi.md §5.5](d3d12_xs_console_abi.md)) |
569| 72 (`+0x240`) | — | console only | `Write64BitValueBottomOfPipeX(address, u64 value, flush, flags)`: the 64-bit value; flags 1 ask for a GPU timestamp and 2 for a system timestamp instead of the value the call carried | 569| 72 (`+0x240`) | — | console only | `Write64BitValueBottomOfPipeX(address, u64 value, flush, flags)`: the 64-bit value; flags 1 ask for a GPU timestamp and 2 for a system timestamp instead of the value the call carried |
570| 73 (`+0x248`) | — | console only | `Wait32BitValueX`: a masked wait on the 32-bit value; stays a no-op | 570| 73 (`+0x248`) | — | console only | `Wait32BitValueX`: a wait on the 32-bit value; the list values hold the queue until it compares true or times out (§5.5 there) |
571| 74 (`+0x250`) | — | console only | `Wait64BitValueX`: a masked wait on the 64-bit value; stays a no-op | 571| 74 (`+0x250`) | — | console only | `Wait64BitValueX`: the same on the 64-bit value |
572| 85 (`+0x2a8`) | — | `CopyTextureRegion` shape (inferred) | run: `(stack pointer, 0, 0)`, twice per dispatch. Statically six arguments, `(&dst, 0, 0, 0, &src, null)`: the public `CopyTextureRegion` (PC 16) with two `D3D12_TEXTURE_COPY_LOCATION`s, not one pointer. At `0x7147` dst is `{texture, SUBRESOURCE_INDEX, 0}` and src `{buffer, PLACED_FOOTPRINT, footprint}`, the footprint from device slot 38 (`GetCopyableFootprints`, `0x708b`); at `0x7191` both are subresource 0 (texture to texture). The caller also clears the next stack argument (`0x70e7`); whether the method takes a seventh is open, as is what console slot 16 is | 572| 85 (`+0x2a8`) | — | `CopyTextureRegion` shape (inferred) | run: `(stack pointer, 0, 0)`, twice per dispatch. Statically six arguments, `(&dst, 0, 0, 0, &src, null)`: the public `CopyTextureRegion` (PC 16) with two `D3D12_TEXTURE_COPY_LOCATION`s, not one pointer. At `0x7147` dst is `{texture, SUBRESOURCE_INDEX, 0}` and src `{buffer, PLACED_FOOTPRINT, footprint}`, the footprint from device slot 38 (`GetCopyableFootprints`, `0x708b`); at `0x7191` both are subresource 0 (texture to texture). The caller also clears the next stack argument (`0x70e7`); whether the method takes a seventh is open, as is what console slot 16 is |
573| 141 (`+0x468`) | — | console only | `(2, GPU VA, size, n)` at `0x65f8`: binds a buffer the DLL names `FFX_XBox_ComputeScratch`; `n` is the bound pipeline's scratch value from pipeline slot 11 (see above) | 573| 141 (`+0x468`) | — | console only | `(2, GPU VA, size, n)` at `0x65f8`: binds a buffer the DLL names `FFX_XBox_ComputeScratch`; `n` is the bound pipeline's scratch value from pipeline slot 11 (see above) |
574 574
@@ -584,7 +584,12 @@ are at 71/72 rather than at 69/70; and `XboxBvhBuilder.dll` reads a 32-bit value
584(slot 73). The call shapes are xcl's (crates/xcl/src/hle/d3d12x/list_x.rs, GPL-2.0) and the deferred 584(slot 73). The call shapes are xcl's (crates/xcl/src/hle/d3d12x/list_x.rs, GPL-2.0) and the deferred
585bottom-of-pipe write model is VIctory's (crates/victory-gpu/src/list.rs, GPL-3.0): the write is not a GPU command, 585bottom-of-pipe write model is VIctory's (crates/victory-gpu/src/list.rs, GPL-3.0): the write is not a GPU command,
586it is a CPU write into the title's memory, made after the submission that recorded it has run. Both projects are 586it is a CPU write into the title's memory, made after the submission that recorded it has run. Both projects are
587cited for facts and for the model only, no code copied. 587cited for facts and for the model only, no code copied. The runtime has two writers for them, one per list: the list
588values (`runtime/shims/d3d12_xs_list_values.h`, on by default) for the lists they track, with the waits of slots 73
589and 74; and the GPU-label path (`runtime/src/vulkan_gpu_labels.h`, `LEONIDA_GPU_LABELS=1`) for the others. Both
590land a write whose address is a GPU address arena offset in the arena, never at that number in host memory, and one
591on a page of xmem's that the title's view keeps `PAGE_NOACCESS` through xmem's own mapping of the physical page
592(`runtime/src/value_write_sink.h`).
588 593
589**The list object is wider than its vtable, and this is what that width is for.** Before a root-argument or dispatch 594**The list object is wider than its vtable, and this is what that width is for.** Before a root-argument or dispatch
590call the DLL checks a write cursor at `+0x18` against a limit (`+0x30` for root arguments, `+0x28` for a dispatch). While there is room, 595call the DLL checks a write cursor at `+0x18` against a limit (`+0x30` for root arguments, `+0x28` for a dispatch). While there is room,